/* ============================================================
   ChastyME — Design-Token CSS + Component Classes
   Derived from approved mockups in design/webpage/
   Dark-only. No light/bone. Square corners default; pill for buttons/inputs/avatars.
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */
:root {
  /* Background layers (tonal dark, no bone) */
  --bg-base:             #0F0A14;
  --bg-surface:          #1A1320;
  --bg-surface-elevated: #241B2D;

  /* Borders — hairlines instead of shadows */
  --border-hairline: #2A2030;
  --border-strong:   #3D2F4A;

  /* Text */
  --text-primary:   #EFE7E0;
  --text-secondary: #9A8E9C;
  --text-tertiary:  #6A5F6E;

  /* Accent — ONE chromatic color */
  --accent-violet:      #A4359A;
  --accent-violet-soft: #7A2575;
  --accent-violet-glow: #D946A0;

  /* Semantic state */
  --state-success: #3D8B6E;
  --state-warning: #C99852;
  --state-danger:  #D1334E;

  /* Typography. 'Noto Sans TC' steht jeweils am Ende der Kette → wird nur fuer CJK-Zeichen
     herangezogen (Latein bleibt Fraunces/Albert Sans/JetBrains Mono). */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', 'Noto Sans TC', serif;
  --font-body:    'Albert Sans', system-ui, -apple-system, 'Noto Sans TC', sans-serif;
  --font-mono:    'JetBrains Mono', 'SFMono-Regular', Menlo, 'Noto Sans TC', monospace;

  /* Layout */
  --maxw:   1280px;
  --gutter: clamp(24px, 5vw, 64px);
}

/* ============================================================
   2. RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Film-grain atmosphere overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }

::selection {
  background: var(--accent-violet);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; }

/* ============================================================
   3. LAYOUT HELPERS
   ============================================================ */
.cm-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ============================================================
   4. TYPOGRAPHY HELPERS
   ============================================================ */

/* Eyebrow — numbered section marker: "01 — SECTION NAME" */
.cm-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

/* Decorative leading rule on eyebrow */
.cm-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--border-strong);
  flex: none;
}

/* Accent number inside eyebrow: <span class="cm-eyebrow__num">01</span> */
.cm-eyebrow__num { color: var(--accent-violet-glow); }

/* Monospace utility — IDs, timers, codes */
.cm-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-tertiary);
}

/* Display heading — Fraunces serif */
.cm-display {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* ============================================================
   5. TOP BAR
   ============================================================ */
.cm-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg-base) 78%, transparent);
  border-bottom: 1px solid var(--border-hairline);
}

.cm-topbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cm-wordmark {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
}

.cm-wordmark__accent { color: var(--accent-violet-glow); }

.cm-topnav {
  display: flex;
  gap: 30px;
  align-items: center;
}

.cm-topnav a {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.cm-topnav a:hover {
  color: var(--text-primary);
  border-color: var(--accent-violet);
}

/* Mobile-Hamburger (Drei-Strich) — auf Desktop ausgeblendet, ab Media Query sichtbar */
.cm-nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  cursor: pointer;
  flex: 0 0 auto;
}
.cm-nav-burger__bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease;
}
/* offen -> die drei Striche werden zum X */
.cm-topbar.is-nav-open .cm-nav-burger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cm-topbar.is-nav-open .cm-nav-burger__bar:nth-child(2) { opacity: 0; }
.cm-topbar.is-nav-open .cm-nav-burger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  /* Hamburger sichtbar; Sprache + App-Logo + Burger nach rechts clustern */
  .cm-nav-burger { display: flex; }
  .cm-topbar__inner { justify-content: flex-start; gap: 10px; }
  .cm-lang-switcher { margin-left: auto; }

  /* .cm-topnav wird vom Inline-Element zum aufklappbaren Vollbreite-Panel */
  .cm-topnav {
    display: none;                 /* geschlossen */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px var(--gutter) 14px;
    background: var(--bg-base);     /* deckend, damit der Seiteninhalt nicht durchscheint */
    border-bottom: 1px solid var(--border-hairline);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
  .cm-topbar.is-nav-open .cm-topnav { display: flex; }   /* aufgeklappt */
  .cm-topnav a {
    font-size: 16px;
    padding: 15px 2px;
    border-bottom: 1px solid var(--border-hairline);
  }
  .cm-topnav a:last-child { border-bottom: none; }
}

/* ============================================================
   6. HERO SECTION (.cm-hero)
   ============================================================ */
.cm-hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-hairline);
}

/* Layered plum glow — evokes splash.png violet light from the right.
   hero.jpg is NOT used as background-image here; it lives as art
   on the right-side grid column (or as overlay when no art slot). */
.cm-hero__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 80% at 82% 30%, rgba(164,53,154,0.32), transparent 60%),
    radial-gradient(45% 60% at 88% 70%, rgba(217,70,160,0.18), transparent 55%),
    radial-gradient(90% 120% at 10% 100%, rgba(26,19,32,0.9), transparent 70%),
    linear-gradient(160deg, #140D1B 0%, #0F0A14 55%, #0B0710 100%);
}

/* Editorial grid rule lines for depth */
.cm-hero__rules {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent calc(var(--maxw) / 12),
    var(--border-hairline) calc(var(--maxw) / 12),
    var(--border-hairline) calc(var(--maxw) / 12 + 1px)
  );
  opacity: 0.4;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

/* Hero shell sits above glow layers */
.cm-hero .cm-shell {
  position: relative;
  z-index: 2;
  padding-block: clamp(64px, 12vh, 140px);
  width: 100%;
}

/* Hero with hero.jpg as full-bleed background (optional variant) */
.cm-hero--image {
  background:
    linear-gradient(160deg, rgba(20,13,27,0.92) 0%, rgba(15,10,20,0.82) 55%),
    url('/vendor/img/hero.jpg') center/cover no-repeat;
}

/* Hero 2-column grid */
.cm-hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

@media (max-width: 980px) {
  .cm-hero__grid { grid-template-columns: 1fr; }
}

/* Hero title — large Fraunces italic */
.cm-hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(48px, 7.4vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  color: var(--text-primary);
}

.cm-hero__title em { color: var(--accent-violet-glow); font-style: italic; }

.cm-hero__lead {
  max-width: 46ch;
  color: var(--text-secondary);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6;
  margin: 0 0 36px;
}

.cm-hero__lead strong { color: var(--text-primary); font-weight: 600; }

.cm-hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* Scroll cue */
.cm-scrollcue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.cm-scrollcue__bar {
  width: 1px;
  height: 38px;
  background: linear-gradient(var(--accent-violet), transparent);
}

/* Eyebrow spacing in hero context */
.cm-hero__eyebrow { margin-bottom: 28px; }

/* ============================================================
   7. CONTENT STRIPE (.cm-stripe)
   Tonal-dark alternation: bg-base <-> bg-surface.
   Never bone/ivory — always dark.
   ============================================================ */
.cm-stripe {
  padding-block: clamp(72px, 12vh, 128px);
  border-bottom: 1px solid var(--border-hairline);
  /* Default: bg-base */
  background: var(--bg-base);
}

/* Even stripes (tonal lift) */
.cm-stripe--surface {
  background: var(--bg-surface);
}

/* Stripe with subtle violet radial accent top-right */
.cm-stripe--accent {
  background:
    radial-gradient(60% 120% at 92% 0%, rgba(122,37,117,0.16), transparent 60%),
    var(--bg-base);
}

/* Stripe with surface + accent */
.cm-stripe--surface-accent {
  background:
    radial-gradient(60% 120% at 8% 100%, rgba(122,37,117,0.12), transparent 55%),
    var(--bg-surface);
}

/* Generic 2-column editorial layout inside stripe */
.cm-stripe__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
}

@media (max-width: 900px) {
  .cm-stripe__grid { grid-template-columns: 1fr; }
}

.cm-stripe__grid--reverse {
  direction: rtl;
}

.cm-stripe__grid--reverse > * {
  direction: ltr;
}

/* Stripe section header */
.cm-stripe__head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 18px 0 18px;
}

.cm-stripe__head h2 em { font-style: italic; color: var(--accent-violet-glow); }
.cm-stripe__head p { color: var(--text-secondary); max-width: 48ch; margin: 0; }

/* ============================================================
   8. BUTTONS
   ============================================================ */
.cm-btn-primary,
.cm-btn-ghost {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 9999px;      /* pill */
  padding: 14px 26px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.cm-btn-primary {
  background: var(--accent-violet);
  color: var(--text-primary);
}

.cm-btn-primary:hover {
  background: var(--accent-violet-soft);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.cm-btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.cm-btn-ghost:hover {
  border-color: var(--accent-violet);
  transform: translateY(-2px);
}

/* Arrow icon inside button */
.cm-btn-arrow { transition: transform .15s ease; }
.cm-btn-primary:hover .cm-btn-arrow,
.cm-btn-ghost:hover .cm-btn-arrow { transform: translateX(3px); }

/* Small button variant */
.cm-btn-primary--sm,
.cm-btn-ghost--sm {
  padding: 9px 18px;
  font-size: 13px;
}

/* ============================================================
   9. INPUTS (.cm-input)
   Pill-shaped, hairline border, focus ring
   ============================================================ */
.cm-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;   /* pill */
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 20px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.cm-input::placeholder { color: var(--text-tertiary); }

.cm-input:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(164,53,154,0.18);
}

/* Pill input with icon + button embedded */
.cm-pill-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  padding: 5px 5px 5px 20px;
  background: var(--bg-base);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cm-pill-input:focus-within {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(164,53,154,0.18);
}

.cm-pill-input__icon {
  width: 17px;
  height: 17px;
  color: var(--text-tertiary);
  flex: none;
}

.cm-pill-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  min-width: 0;
}

.cm-pill-input input::placeholder { color: var(--text-tertiary); }

/* Field wrapper (label + input) */
.cm-field { margin-bottom: 26px; }

.cm-field > label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ============================================================
   10. CARD (.cm-card)
   Hairline border + tonal surface. No box-shadow on dark.
   ============================================================ */
.cm-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;          /* slight radius — cards get md */
  padding: clamp(24px, 3vw, 38px);
  position: relative;
}

/* Optional corner tick decorations (editorial framing) */
.cm-card--ticked::before,
.cm-card--ticked::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--border-strong);
  border-style: solid;
}

.cm-card--ticked::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.cm-card--ticked::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1px 1px 0;
}

/* Elevated card (hover or featured) */
.cm-card--elevated {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
}

/* ============================================================
   11. TILE GRID (.cm-tile-grid + .cm-tile)
   Used for feature/teaser tiles (3-across, separated by hairlines)
   ============================================================ */
.cm-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-hairline);
  border: 1px solid var(--border-hairline);
}

@media (max-width: 860px) {
  .cm-tile-grid { grid-template-columns: 1fr; }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .cm-tile-grid { grid-template-columns: repeat(2, 1fr); }
}

.cm-tile {
  background: var(--bg-surface);
  padding: clamp(26px, 3vw, 38px);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background .2s ease;
  text-decoration: none;
  color: var(--text-primary);
}

.cm-tile:hover { background: var(--bg-surface-elevated); }

.cm-tile__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-violet-glow);
  letter-spacing: 0.08em;
  margin-bottom: auto;
}

.cm-tile__icon {
  width: 30px;
  height: 30px;
  margin: 0 0 22px;
  color: var(--text-secondary);
}

.cm-tile h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 18px 0 10px;
  color: var(--text-primary);
}

.cm-tile p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 22px;
}

.cm-tile__link {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.cm-tile__link svg {
  width: 15px;
  height: 15px;
  transition: transform .15s ease;
}

.cm-tile:hover .cm-tile__link svg { transform: translateX(4px); }
.cm-tile:hover .cm-tile__link { color: var(--accent-violet-glow); }

/* Promise-/Summary-Kachel (sechstes Feld) — leicht violett abgesetzt + Akzent-Oberkante */
.cm-tile--promise {
  background:
    linear-gradient(155deg, rgba(164, 53, 154, 0.16), rgba(122, 37, 117, 0.05)),
    var(--bg-surface);
  box-shadow: inset 0 2px 0 var(--accent-violet);
}
.cm-tile--promise:hover {
  background:
    linear-gradient(155deg, rgba(164, 53, 154, 0.24), rgba(122, 37, 117, 0.08)),
    var(--bg-surface-elevated);
}
.cm-tile--promise .cm-tile__icon { margin-top: auto; }
.cm-tile__icon--accent { color: var(--accent-violet-glow); }
.cm-tile--promise .cm-tile__link { color: var(--accent-violet-glow); }

/* Zusatz-Attribut-Badges (Learner "L", finanzielles Interesse "$") */
.cm-attr-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.cm-attr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--border-strong);
  background: var(--bg-base);
}
.cm-attr-badge--learner {
  color: var(--accent-violet-glow);
  border-color: var(--accent-violet-soft);
}
.cm-attr-badge--finance {
  color: var(--state-warning);
  border-color: var(--state-warning);
}

/* ============================================================
   12. LANGUAGE SWITCHER (.cm-lang-switcher)
   ============================================================ */
.cm-lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cm-lang-switcher__btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 3px;
  transition: color .15s ease, background .15s ease;
  line-height: 1;
}

.cm-lang-switcher__btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.cm-lang-switcher__btn--active {
  color: var(--accent-violet-glow);
  background: var(--bg-surface);
}

.cm-lang-switcher__sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

/* Select-based lang switcher (32 locales) */
.cm-lang-switcher__select {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 4px 8px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: color .15s ease, border-color .15s ease;
}

.cm-lang-switcher__select:hover {
  color: var(--text-primary);
  border-color: var(--accent-violet);
}

.cm-lang-switcher__select:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 2px rgba(164,53,154,0.18);
}

/* Navbar-App-Logo — als kleines App-Icon-Chip, begrenzt die Bar-Höhe nicht.
   Nur ab >= 1140px Viewport-Breite sichtbar (sonst ausgeblendet). */
.cm-nav-applogo {
  display: none;
  align-items: center;
  margin-left: 12px;
  flex: 0 0 auto;
}
@media (min-width: 1140px) {
  .cm-nav-applogo {
    display: inline-flex;
  }
}
.cm-nav-applogo img {
  height: 56px;
  width: 56px;
  display: block;
  border-radius: 10px;
}

/* ============================================================
   13. LOGO / WORDMARK
   ============================================================ */
.cm-logo-icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ============================================================
   14. SIGNUP / FORM CARD PATTERNS
   ============================================================ */
.cm-signup {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: clamp(24px, 3vw, 38px);
  position: relative;
}

/* Corner ticks on signup cards */
.cm-signup::before,
.cm-signup::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--border-strong);
  border-style: solid;
}

.cm-signup::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.cm-signup::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.cm-fineprint {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin: 0;
}

.cm-fineprint a {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
}

.cm-fineprint a:hover {
  color: var(--accent-violet-glow);
  border-color: var(--accent-violet);
}

/* ============================================================
   15. CODEX / LIST PATTERNS
   ============================================================ */
.cm-codex-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cm-codex-list li {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.cm-codex-list li:last-child { border-bottom: none; }

.cm-codex-list li::before {
  content: attr(data-mark);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  flex: none;
  margin-top: 2px;
  width: 18px;
}

.cm-codex-list--allow li::before { color: var(--accent-violet); }

.cm-codex-list li strong { color: var(--text-primary); font-weight: 600; }

/* ============================================================
   16. FOOTER
   ============================================================ */
.cm-footer {
  padding-block: clamp(48px, 8vh, 80px);
  background: var(--bg-base);
  border-top: 1px solid var(--border-hairline);
}

.cm-footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-hairline);
}

.cm-footer__brand .cm-wordmark { font-size: 22px; }

.cm-footer__tag {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 14px;
  font-size: 17px;
}

.cm-footer__links {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.cm-footer__col h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 16px;
}

.cm-footer__col a {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 6px 0;
  transition: color .15s ease;
}

.cm-footer__col a:hover { color: var(--accent-violet-glow); }

.cm-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 28px;
}

/* ============================================================
   17. SECTION HEAD (shared heading pattern)
   ============================================================ */
.cm-section-head {
  margin-bottom: 56px;
}

.cm-section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 18px 0 0;
}

.cm-section-head h2 em { font-style: italic; color: var(--accent-violet-glow); }

.cm-section-head--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

/* ============================================================
   18. PILLARS (brand tagline row)
   ============================================================ */
.cm-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

.cm-pillars span {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 2.1vw, 24px);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  position: relative;
}

.cm-pillars span::after {
  content: "·";
  margin-left: 26px;
  color: var(--text-tertiary);
  font-style: normal;
}

.cm-pillars span:last-child::after { content: none; }

/* ============================================================
   19. ENTRANCE ANIMATIONS
   All gated behind prefers-reduced-motion: no-preference
   Content is visible at rest (opacity:1/transform:none by default).
   ============================================================ */
@keyframes cm-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .cm-animate-rise {
    animation: cm-rise .8s ease forwards;
  }

  .cm-animate-rise--fast  { animation-duration: .6s; }
  .cm-animate-rise--slow  { animation-duration: 1s; }

  /* Stagger delays via modifier classes */
  .cm-delay-1  { animation-delay: .05s; }
  .cm-delay-2  { animation-delay: .12s; }
  .cm-delay-3  { animation-delay: .22s; }
  .cm-delay-4  { animation-delay: .32s; }
  .cm-delay-5  { animation-delay: .42s; }
  .cm-delay-6  { animation-delay: .52s; }
  .cm-delay-7  { animation-delay: .62s; }
}

/* Reduced-motion: ensure everything is visible */
@media (prefers-reduced-motion: reduce) {
  .cm-animate-rise,
  [class*="cm-animate-"] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   20. UTILITY: HAIRLINE DIVIDER
   ============================================================ */
.cm-hairline {
  border: none;
  border-top: 1px solid var(--border-hairline);
  margin: 0;
}

/* ============================================================
   21. PHONE COMPOSITE (hero art mock)
   ============================================================ */
.cm-phone {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%) rotate(-3deg);
  width: 232px;
  aspect-ratio: 9 / 19.5;
  border-radius: 30px;
  background: linear-gradient(155deg, #221A2C, #160F1D);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 120px rgba(164,53,154,0.18), 0 4px 24px rgba(0,0,0,0.6);
  padding: 12px;
}

.cm-phone__screen {
  height: 100%;
  border-radius: 20px;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(164,53,154,0.22), transparent 60%),
    var(--bg-base);
  border: 1px solid var(--border-hairline);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
}

/* ============================================================
   21b. DEVICE VIEW (wiederverwendbarer CSS-iPhone-Rahmen)
   Zwei Varianten ueber Modifier:
     .cm-device--tilted  -> ~30 Grad gedreht (yaw) + 10 Grad gekippt (pitch)
     .cm-device--flat    -> frontal (0/0), fuer Funktions-Erklaerungen
   Der Screenshot (.cm-device__screen) ist 3D-Kind und wird durch die
   perspective()-Transform automatisch perspektivisch in den Rahmen projiziert.
   Winkel/Perspektive sind als CSS-Variablen einstellbar.
   ============================================================ */
.cm-device {
  /* einstellbare Geometrie */
  --cm-device-persp: 1600px;
  --cm-device-yaw: 0deg;       /* "gedreht": + = nach rechts, - = nach links */
  --cm-device-pitch: 0deg;     /* "gekippt" */
  --cm-device-layers: 20;      /* Anzahl Tiefen-Schichten (Korpus-Extrusion, nur tilted sichtbar) */
  --cm-device-step: 1.1px;     /* Z-Abstand je Schicht -> Gesamttiefe ~ layers * step */
  --cm-device-shadow-x: 0px;   /* horizontaler Schlagschatten-Versatz (folgt der Drehung) */
  --cm-device-glow-x: 0px;     /* horizontaler Versatz des Violett-Glows */

  /* Buehne: nur Layout + Schlagschatten im Screen-Space (wirkt wie Bodenschatten).
     Der filter MUSS hier liegen, NICHT auf .cm-device__body: ein filter auf einem
     preserve-3d-Element erzwingt transform-style:flat und wuerde die Korpus-Tiefe
     (die 3D-Seitenkanten) wieder plattdruecken. */
  position: relative;
  width: clamp(220px, 24vw, 300px);
  aspect-ratio: 9 / 19.5;
  margin: auto;
  filter:
    drop-shadow(var(--cm-device-shadow-x) 30px 44px rgba(0, 0, 0, 0.55))
    drop-shadow(var(--cm-device-glow-x) 10px 40px rgba(164, 53, 154, 0.16));
}

/* 3D-Korpus: Titan-Bezel mit Drehung + Perspektive. Traegt preserve-3d, damit die
   Seitenkanten (.cm-device__edge) echte Tiefe bekommen — deshalb hier KEIN filter. */
.cm-device__body {
  position: absolute;
  inset: 0;
  border-radius: 44px;
  /* Titan-Bezel: metallische Kante */
  background: linear-gradient(150deg, #3a2f44 0%, #221a2c 38%, #160f1d 100%);
  border: 1px solid var(--border-strong);
  padding: 10px;
  transform-style: preserve-3d;
  transform:
    perspective(var(--cm-device-persp))
    rotateY(var(--cm-device-yaw))
    rotateX(var(--cm-device-pitch));
  will-change: transform;
}

/* Dynamic-Island */
.cm-device__island {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateZ(1px);
  width: 30%;
  height: 16px;
  border-radius: 9999px;
  background: #05030a;
  z-index: 2;
  pointer-events: none;
}

/* ---- 3D-Korpus-Tiefe per Schicht-Stapel (Extrusion) ----
   Statt EINER um 90 Grad geklappten Seitenwand (sah wie ein aufgesetztes Rechteck
   aus) wird der Korpus aus vielen identischen, runden Schicht-Kopien gebaut, die
   Stueck fuer Stueck nach hinten (−Z) versetzt und nach hinten zunehmend dunkler
   schattiert sind. Bei der tilted-Drehung verschmelzen die sichtbaren Schicht-
   Raender zu einer durchgehenden, leicht gewoelbten Gehaeuse-Seitenflaeche — die
   abgerundeten Ecken bekommen dadurch automatisch korrekte Tiefe.
   --cm-device-layers: Anzahl der Schichten; --cm-device-step: Z-Abstand je Schicht.
   Default ausgeblendet -> die frontale .cm-device--flat bleibt flach/unveraendert. */
.cm-device__layer {
  position: absolute;
  inset: 0;
  border-radius: 44px;
  /* nach hinten zunehmend dunkler -> die Seitenflaeche hebt sich von der Front ab */
  background: color-mix(in srgb, #2c2436, #06040b calc(var(--i) * 4.2%));
  transform: translateZ(calc(var(--i) * var(--cm-device-step) * -1));
  display: none;
}
/* leichte Lichtkante auf der vordersten Tiefen-Schicht (Uebergang Front -> Korpus) */
.cm-device__layer[style*="--i:1;"],
.cm-device__layer[style*="--i:1 "] {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Hardware-Tasten: schmale, leicht erhabene Leisten, die mittig in der Korpus-
   Tiefe sitzen und an der zum Betrachter zeigenden Laengskante herausschauen. */
.cm-device__btn {
  position: absolute;
  width: 5px;
  border-radius: 2px;
  background: linear-gradient(180deg, #574a64 0%, #2a2136 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  /* mittig in der Tiefe (halbe Korpustiefe nach hinten) */
  transform: translateZ(calc(var(--cm-device-step) * var(--cm-device-layers) * -0.5));
  display: none;
}
/* rechte Laengskante (zeigt bei tilted-left zum Betrachter) */
.cm-device__btn--power  { right: -3px; top: 30%; height: 64px; }
/* linke Laengskante (zeigt bei tilted-right zum Betrachter) */
.cm-device__btn--volume { left: -3px; top: 26%; height: 92px; }

/* Tiefe + Tasten nur bei den gekippten Varianten. */
.cm-device--tilted .cm-device__layer,
.cm-device--tilted-left .cm-device__layer,
.cm-device--tilted-right .cm-device__layer,
.cm-device--tilted .cm-device__btn,
.cm-device--tilted-left .cm-device__btn,
.cm-device--tilted-right .cm-device__btn { display: block; }

.cm-device__screen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 34px;
  background: var(--bg-base);
  border: 1px solid var(--border-hairline);
}

/* Nach RECHTS gedreht (Bildschirm zeigt nach rechts) — fuer Phone LINKS positioniert. */
.cm-device--tilted-right {
  --cm-device-yaw: 30deg;
  --cm-device-pitch: 10deg;
  --cm-device-shadow-x: -18px;
  --cm-device-glow-x: -6px;
}

/* Nach LINKS gedreht (Bildschirm zeigt nach links/zum Betrachter) — fuer Phone RECHTS positioniert. */
.cm-device--tilted-left {
  --cm-device-yaw: -30deg;
  --cm-device-pitch: 10deg;
  --cm-device-shadow-x: 18px;
  --cm-device-glow-x: 6px;
}

/* Alias: "tilted" == nach rechts gedreht (Abwaertskompatibilitaet). */
.cm-device--tilted {
  --cm-device-yaw: 30deg;
  --cm-device-pitch: 10deg;
  --cm-device-shadow-x: -18px;
  --cm-device-glow-x: -6px;
}

.cm-device--flat {
  --cm-device-yaw: 0deg;
  --cm-device-pitch: 0deg;
  --cm-device-shadow-x: 0px;
  --cm-device-glow-x: 0px;
}

@media (prefers-reduced-motion: reduce) {
  .cm-device__body { will-change: auto; }
}

/* ============================================================
   21c. GERÄTE-PRODUKTBILD-FRAME — "Vitrine"
   Spotlight-Nische für Produktfotos in den /geraete-Karten.
   Robust für transparente UND opak-hinterlegte Produktbilder.
   ============================================================ */
.cm-geraete-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  /* Bild wird absolut per object-fit eingepasst (Safari-sicher) — KEIN Flex-Centering,
     da Safari Prozent-max-height bei Flex-Kindern in aspect-ratio-Boxen nicht auflöst. */
  /* Spotlight-Schein (violett) über dunklem Verlauf */
  background:
    radial-gradient(120% 90% at 50% 38%, rgba(164, 53, 154, 0.20) 0%, rgba(164, 53, 154, 0.05) 40%, transparent 70%),
    linear-gradient(180deg, #1A1222 0%, #120C18 100%);
  border: 1px solid var(--border-hairline);
  box-shadow: inset 0 2px 0 var(--accent-violet);   /* obere Akzent-Hairline */
  margin-bottom: clamp(20px, 2.5vw, 28px);
}

.cm-geraete-frame__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Innenabstand statt max-width/max-height in % — Safari skaliert die Prozent-Max-Höhe
     eines Flex-Kindes in einer aspect-ratio-Box nicht zuverlässig (Chrome schon). */
  padding: 9% 11%;
  box-sizing: border-box;
  display: block;
}

/* Cagink Pro (Cellmate3Pro) hat viel transparenten Rand → weniger Padding = Motiv groesser */
.cm-geraete-frame__img[src*="Cellmate3Pro"] {
  padding: 2% 4%;
}

/* Full-bleed an die obere/seitliche Kartenkante (hebt das Karten-Padding auf) */
.cm-card > .cm-geraete-frame:first-child {
  margin-top: calc(-1 * clamp(24px, 3vw, 38px));
  margin-left: calc(-1 * clamp(24px, 3vw, 38px));
  margin-right: calc(-1 * clamp(24px, 3vw, 38px));
}

/* Mobile / Einzelspalte (≤640px): bei voller Kartenbreite würde das hohe 4:3-Frame
   den Portrait-Viewport dominieren → flacheres Frame (3:2) + kleineres Produktbild.
   2-Spalten-Layouts (>640px) bleiben unberührt. */
@media (max-width: 640px) {
  .cm-geraete-frame { aspect-ratio: 3 / 2; }
  .cm-geraete-frame__img { padding: 18% 21%; }
  .cm-geraete-frame__img[src*="Cellmate3Pro"] { padding: 10% 14%; }
}

/* ============================================================
   21d. GERÄTE-GRID + ZUSAMMENFASSUNGS-KACHEL
   Flexbox statt Grid, damit die Summary-Kachel den restlichen
   Zeilenplatz NEBEN den Geräte-Kacheln auffüllt — niemals leere
   Platzhalter. Wird später durch echte Geräte-Kacheln ersetzt.
   ============================================================ */
.cm-device-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--border-hairline);   /* Hairline-Trennlinien über gap */
  border: 1px solid var(--border-hairline);
  margin-top: 40px;
}
.cm-device-grid > .cm-card {
  flex: 1 1 320px;       /* Geräte-Kacheln wachsen, füllen volle Zeilen */
  min-width: 0;
}
/* Summary-Kachel verschlingt den restlichen Platz ihrer Zeile */
.cm-device-grid > .cm-device-grid__summary {
  flex: 1000 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(164, 53, 154, 0.10) 0%, rgba(164, 53, 154, 0.03) 100%),
    var(--bg-surface);
  box-shadow: inset 0 2px 0 var(--accent-violet);   /* obere Akzent-Hairline */
}

/* ============================================================
   22. ADULT-GATE MODAL PLACEHOLDER
   (Modal overlay styled on-brand — no Bootstrap modal overrides)
   ============================================================ */
.cm-gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15,10,20,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cm-gate-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  padding: 40px 36px;
  text-align: center;
}

.cm-gate-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 16px;
}

.cm-gate-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 28px;
}

/* ============================================================
   23. LEGAL PAGE PATTERNS
   ============================================================ */
.cm-legal-nav {
  position: sticky;
  top: 74px; /* below topbar */
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 20px;
  align-self: start;
}

.cm-legal-nav a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-hairline);
  transition: color .15s ease;
}

.cm-legal-nav a:last-child { border-bottom: none; }
.cm-legal-nav a:hover { color: var(--accent-violet-glow); }
.cm-legal-nav a.active { color: var(--text-primary); font-weight: 600; }

.cm-legal-content h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 32px);
  margin: 64px 0 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border-hairline);
}

.cm-legal-content h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.cm-legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.cm-legal-content p,
.cm-legal-content li {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.cm-legal-content strong { color: var(--text-primary); }

.cm-legal-content a {
  color: var(--accent-violet-glow);
  border-bottom: 1px solid rgba(217,70,160,0.3);
  transition: border-color .15s ease;
}

.cm-legal-content a:hover { border-color: var(--accent-violet-glow); }

/* ---- reading page shell ---- */
.cm-legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 88px) clamp(20px, 5vw, 48px) clamp(64px, 12vh, 120px);
}

/* ---- page header ---- */
.cm-legal-header { margin-bottom: 48px; }

.cm-legal-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.cm-legal-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--border-strong);
}

.cm-legal-eyebrow__num { color: var(--accent-violet-glow); }

.cm-legal-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.07;
  letter-spacing: -0.022em;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.cm-legal-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin: 0 0 20px;
}

/* draft disclaimer */
.cm-legal-draft {
  font-style: italic;
  font-size: 13px;
  color: var(--text-tertiary);
  border-left: 2px solid var(--accent-violet-soft);
  padding: 10px 16px;
  margin: 20px 0 0;
  background: var(--bg-surface);
}

/* ---- in-page TOC ---- */
.cm-legal-toc {
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  padding: 20px 0;
  margin-bottom: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.cm-legal-toc a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border: none;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  transition: color .15s;
}

.cm-legal-toc a:hover { color: var(--accent-violet-glow); border: none; }

.cm-legal-toc__i {
  color: var(--text-tertiary);
  font-size: 11px;
}

/* ---- section heading with mono section number ---- */
.cm-legal-content section { scroll-margin-top: 80px; }

.cm-legal-content h2 {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.cm-legal-sec {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent-violet-glow);
  flex: none;
  letter-spacing: 0.04em;
}

/* ---- definition list (provider data / data-types) ---- */
.cm-legal-deflist {
  border-top: 1px solid var(--border-hairline);
  margin: 20px 0 28px;
}

.cm-legal-deflist__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-hairline);
}

@media (max-width: 560px) {
  .cm-legal-deflist__row { grid-template-columns: 1fr; gap: 4px; }
}

.cm-legal-deflist__row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0;
  padding: 0;
  font-weight: 400;
}

.cm-legal-deflist__row dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* ---- bullet list ---- */
.cm-legal-content ul {
  padding: 0;
  margin: 0 0 18px;
  list-style: none;
}

.cm-legal-content ul li {
  position: relative;
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--border-hairline);
}

.cm-legal-content ul li:last-child { border-bottom: none; }

.cm-legal-content ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 17px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent-violet);
}

/* ---- back link ---- */
.cm-legal-back {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.cm-legal-back a {
  color: var(--text-secondary);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .15s;
}

.cm-legal-back a:hover { color: var(--accent-violet-glow); }

.cm-legal-back a::before {
  content: "←";
  font-family: var(--font-mono);
  color: var(--accent-violet-glow);
}

/* ============================================================
   24. RESPONSIVE UTILITIES
   ============================================================ */
@media (max-width: 760px) {
  .cm-hide-mobile { display: none !important; }
}

@media (min-width: 761px) {
  .cm-hide-desktop { display: none !important; }
}

/* ============================================================
   25. SCROLLBAR (webkit) — minimal, on-brand
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-violet-soft); }

/* Contact-form textarea — matches the field inputs */
.cm-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-1, #171221);
  border: 1px solid var(--border-subtle, #271f3a);
  border-radius: 14px;
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 14px 16px;
  resize: vertical;
}
.cm-field textarea:focus {
  outline: none;
  border-color: var(--accent-violet-glow, #7c5cff);
}
/* Direct-child only — must NOT restyle the Beta pill input, which is nested
   in .cm-pill-input and stays transparent (see .cm-pill-input input above). */
.cm-field > input[type="text"],
.cm-field > input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-1, #171221);
  border: 1px solid var(--border-subtle, #271f3a);
  border-radius: 14px;
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
  padding: 14px 16px;
}
.cm-field > input[type="text"]:focus,
.cm-field > input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-violet-glow, #7c5cff);
}

/* =============================================================================
   PORTAL — Authentifizierter Operator-Bereich (/portal/**)
   ============================================================================= */

/* Zentrierte schmale Spalte für Auth-Seiten (Login, Setup, 2FA, Recovery) */
.cm-portal-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background: var(--surface-1, #171221);
  font-family: var(--font-body, 'Albert Sans', sans-serif);
}

.cm-portal-auth h1 {
  color: var(--accent-violet-glow, #7c5cff);
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}

.cm-portal-auth form {
  background: #1e1630;
  border: 1px solid var(--border-hairline, #2d2347);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Horizontale Navigationsleiste */
.cm-portal-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.5rem;
  background: #1a1228;
  border-bottom: 1px solid var(--border-hairline, #2d2347);
  font-family: var(--font-body, 'Albert Sans', sans-serif);
  flex-wrap: wrap;
}

.cm-portal-marke {
  font-weight: 700;
  color: var(--accent-violet-glow, #7c5cff);
  margin-right: 0.5rem;
  letter-spacing: 0.02em;
}

.cm-portal-nav a {
  color: #c4b8e8;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.cm-portal-nav a:hover {
  background: rgba(124, 92, 255, 0.15);
  color: #fff;
}

/* Hauptinhalt */
.cm-portal-main {
  padding: 2rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  font-family: var(--font-body, 'Albert Sans', sans-serif);
  color: #e0d8f8;
}

.cm-portal-main h1 {
  color: var(--accent-violet-glow, #7c5cff);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Kachel-Grid (Dashboard-Tiles) */
.cm-portal-kacheln {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.cm-portal-kachel {
  flex: 1 1 260px;
  background: #1e1630;
  border: 1px solid var(--border-hairline, #2d2347);
  border-radius: 16px;
  padding: 1.5rem;
  text-decoration: none;
  color: #e0d8f8;
  transition: border-color 0.15s, background 0.15s;
  display: block;
}

.cm-portal-kachel:hover {
  border-color: var(--accent-violet-glow, #7c5cff);
  background: #231940;
}

.cm-portal-kachel h2 {
  color: var(--accent-violet-glow, #7c5cff);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.cm-portal-kachel p {
  margin: 0;
  font-size: 0.875rem;
  color: #a090c8;
}

/* Aktive (verfügbare) Kachel — abgesetzt von den „folgt"-Platzhaltern */
.cm-portal-kachel--aktiv {
  border-color: var(--accent-violet-soft, #7A2575);
  background: #231940;
}
.cm-portal-kachel__oeffnen {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-violet-glow, #D946A0);
}

/* Feedback-Boxen */
.cm-portal-fehler {
  background: rgba(220, 50, 50, 0.12);
  border: 1px solid rgba(220, 50, 50, 0.4);
  border-radius: 10px;
  color: #f88;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.cm-portal-hinweis {
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.35);
  border-radius: 10px;
  color: #c4b8e8;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.cm-portal-warnung {
  background: rgba(220, 160, 20, 0.12);
  border: 1px solid rgba(220, 160, 20, 0.4);
  border-radius: 10px;
  color: #f5c842;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* QR-Code-Anzeige (TOTP-Enrollment) */
.cm-portal-qr {
  max-width: 220px;
  border-radius: 12px;
  border: 1px solid var(--border-hairline, #2d2347);
  display: block;
  margin: 1rem auto;
}

/* Recovery-Code-Liste (monospace, gut lesbar) */
.cm-portal-codes {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  line-height: 2;
  letter-spacing: 0.08em;
  background: #120e1e;
  border: 1px solid var(--border-hairline, #2d2347);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  color: #c4ffc4;
  list-style: none;
  margin: 0;
}

/* Logout-Formular in der Nav */
.cm-portal-logout {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.cm-portal-logout button {
  background: transparent;
  border: 1px solid var(--border-hairline, #2d2347);
  border-radius: 8px;
  color: #a090c8;
  cursor: pointer;
  font-family: var(--font-body, 'Albert Sans', sans-serif);
  font-size: 0.875rem;
  padding: 0.3rem 0.8rem;
  transition: border-color 0.15s, color 0.15s;
}

.cm-portal-logout button:hover {
  border-color: var(--accent-violet-glow, #7c5cff);
  color: #fff;
}

/* ============================================================
   STATISTIK — /portal/statistik Dashboard
   ============================================================ */

.cm-portal-tabelle {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-primary, #EFE7E0);
}

.cm-portal-tabelle th,
.cm-portal-tabelle td {
  padding: 0.55rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-hairline, #2A2030);
}

.cm-portal-tabelle thead th {
  background: var(--bg-surface, #1A1320);
  color: var(--text-secondary, #9A8E9C);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cm-portal-tabelle tbody tr:hover td {
  background: var(--bg-surface-elevated, #241B2D);
}

.cm-portal-tabelle tbody tr.cm-aktiv td {
  background: var(--bg-surface-elevated, #241B2D);
  border-left: 3px solid var(--accent-violet, #A4359A);
}

.cm-portal-tabelle td a {
  color: var(--accent-violet-glow, #D946A0);
  text-decoration: none;
}

.cm-portal-tabelle td a:hover {
  text-decoration: underline;
}

.cm-stat-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.cm-stat-toggle a {
  padding: 0.3rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--border-hairline, #2A2030);
  color: var(--text-secondary, #9A8E9C);
  font-size: 0.85rem;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.cm-stat-toggle a:hover {
  border-color: var(--accent-violet, #A4359A);
  color: var(--text-primary, #EFE7E0);
}

.cm-stat-toggle a.cm-aktiv {
  background: var(--accent-violet-soft, #7A2575);
  border-color: var(--accent-violet, #A4359A);
  color: #fff;
}

.cm-stat-kpi {
  font-size: 0.95rem;
  color: var(--text-secondary, #9A8E9C);
  margin-bottom: 1rem;
}

.cm-stat-kpi strong {
  color: var(--text-primary, #EFE7E0);
}

#chart {
  display: block;
  max-width: 100%;
  background: var(--bg-surface, #1A1320);
  border-radius: 8px;
  padding: 1rem;
}

/* --- Portal: Beta-Dashboard --- */
.cm-portal-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.cm-portal-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  padding: 0.75rem 1rem;
  background: var(--bg-surface, #1A1320);
  border: 1px solid var(--border-hairline, #2d2347);
  border-radius: 10px;
}

.cm-portal-kpi span {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-violet-glow, #7c5cff);
  line-height: 1.1;
}

.cm-portal-kpi label {
  font-size: 0.75rem;
  color: var(--text-secondary, #9A8E9C);
  margin-top: 0.25rem;
  text-align: center;
}

.cm-beta-eintrag {
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-hairline, #2d2347);
  border-radius: 8px;
  overflow: hidden;
}

.cm-beta-eintrag > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  background: var(--bg-surface, #1A1320);
  list-style: none;
}

.cm-beta-eintrag > summary::-webkit-details-marker { display: none; }

.cm-beta-mail {
  font-weight: 600;
  color: var(--text-primary, #EFE7E0);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cm-beta-datum {
  font-size: 0.8rem;
  color: var(--text-secondary, #9A8E9C);
  white-space: nowrap;
}

.cm-beta-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--border-hairline, #2d2347);
  color: var(--text-secondary, #9A8E9C);
  white-space: nowrap;
}

.cm-beta-badge--ok {
  background: #163a22;
  color: #4ade80;
}

.cm-beta-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  background: #110e1c;
}

.cm-beta-detail dt {
  color: var(--text-secondary, #9A8E9C);
  white-space: nowrap;
}

.cm-beta-detail dd {
  color: var(--text-primary, #EFE7E0);
  margin: 0;
}

.cm-beta-loeschen {
  padding: 0.5rem 0.9rem 0.75rem;
  background: #110e1c;
}

.cm-portal-gefahr {
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  border: 1px solid #7f1d1d;
  background: #3b0c0c;
  color: #fca5a5;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.cm-portal-gefahr:hover {
  background: #5c1212;
  border-color: #ef4444;
  color: #fecaca;
}

/* KONTAKT-INBOX — /portal/kontakt */

.cm-kontakt-original {
  border: 1px solid var(--border-hairline, #2d2347);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  background: var(--bg-surface, #1A1320);
}

.cm-kontakt-original h1 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary, #EFE7E0);
  margin: 0 0 0.5rem;
}

.cm-kontakt-meta {
  font-size: 0.8rem;
  color: var(--text-secondary, #9A8E9C);
  margin: 0 0 0.75rem;
}

.cm-kontakt-nachricht {
  white-space: pre-wrap;
  color: var(--text-primary, #EFE7E0);
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.6;
}

.cm-kontakt-antworten {
  margin-bottom: 1.75rem;
}

.cm-kontakt-antworten h2,
.cm-kontakt-reply h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #EFE7E0);
  margin: 0 0 0.75rem;
}

.cm-kontakt-antwort {
  border-left: 3px solid var(--accent-violet-glow, #7c5cff);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg-surface, #1A1320);
  border-radius: 0 8px 8px 0;
}

.cm-kontakt-html {
  font-size: 0.92rem;
  color: var(--text-primary, #EFE7E0);
  line-height: 1.6;
}

.cm-kontakt-html p { margin: 0.25rem 0; }

.cm-kontakt-reply {
  margin-bottom: 2rem;
}

#editor {
  min-height: 160px;
  background: #1a1320;
  color: var(--text-primary, #EFE7E0);
  border: 1px solid var(--border-hairline, #2d2347);
  border-radius: 6px 6px 0 0;
  margin-bottom: 0;
}

#antwort-form {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

#antwort-form button[type="submit"] {
  padding: 0.4rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--accent-violet-glow, #7c5cff);
  background: transparent;
  color: var(--accent-violet-glow, #7c5cff);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#antwort-form button[type="submit"]:hover {
  background: var(--accent-violet-glow, #7c5cff);
  color: #fff;
}

.cm-kontakt-abschliessen {
  margin-top: 0.6rem;
}
