﻿/* ═══════════════════════════════════════════════════════════════════════════
   INFORMATIK ZENTRUM — Design System v2.0
   Basis: UI/UX Pro Max · Enterprise Gateway · Minimalism & Swiss Style
   Farben: Dark Anthracite + Deep Green + Gold Accent
   Fonts: DM Sans (Google Fonts)
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Brand — Emerald Intelligence */
  --c-green:        #059669;
  --c-green-mid:    #10b981;
  --c-green-light:  #d1fae5;
  --c-green-hover:  #ecfdf5;
  --c-green-subtle: #f0fdf4;

  /* Gold / Amber */
  --c-gold:         #d97706;
  --c-gold-mid:     #f59e0b;
  --c-gold-light:   #fef3c7;
  --c-gold-bg:      #fffbeb;

  /* Neutrals — Slate-based */
  --c-ink:          #0f172a;
  --c-ink-mid:      #1e293b;
  --c-ink-soft:     #334155;
  --c-muted:        #64748b;
  --c-muted-light:  #94a3b8;
  --c-border:       #e2e8f0;
  --c-border-soft:  #f1f5f9;
  --c-surface:      #f8fafc;
  --c-surface-mid:  #f1f5f9;
  --c-white:        #ffffff;

  /* Hero / Dark section */
  --c-hero-bg:      #040d21;
  --c-hero-mid:     #071428;
  --c-hero-surface: rgba(255,255,255,.04);
  --c-hero-border:  rgba(255,255,255,.08);
  --c-neon:         #00e5a0;
  --c-neon-dim:     rgba(0,229,160,.15);
  --c-neon-glow:    rgba(0,229,160,.25);

  /* Danger / Warning / Success */
  --c-danger:       #dc2626;
  --c-danger-bg:    #fef2f2;
  --c-warn:         #d97706;
  --c-warn-bg:      #fffbeb;
  --c-success:      #16a34a;
  --c-success-bg:   #f0fdf4;

  /* Layout */
  --header-h:       64px;
  --sidebar-w:      260px;
  --content-max:    1280px;
  --content-pad:    clamp(16px, 3vw, 48px);

  /* Radii */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;

  /* Shadows */
  --shadow-xs:  0 1px 3px rgba(12,10,9,.06), 0 1px 2px rgba(12,10,9,.04);
  --shadow-sm:  0 2px 8px rgba(12,10,9,.08), 0 1px 3px rgba(12,10,9,.04);
  --shadow-md:  0 4px 20px rgba(12,10,9,.10), 0 2px 6px rgba(12,10,9,.05);
  --shadow-lg:  0 12px 40px rgba(12,10,9,.13), 0 4px 12px rgba(12,10,9,.06);
  --shadow-xl:  0 20px 60px rgba(12,10,9,.16), 0 8px 20px rgba(12,10,9,.08);

  /* Z-Index Scale */
  --z-content:  1;
  --z-sticky:   10;
  --z-sidebar:  20;
  --z-dropdown: 30;
  --z-overlay:  40;
  --z-modal:    50;
  --z-header:   60;
  --z-toast:    70;

  /* Transitions */
  --t-fast:   140ms ease;
  --t-base:   200ms ease;
  --t-slow:   300ms ease;
}

/* ─── Dark Mode ──────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --c-surface:      #0f172a;
  --c-surface-mid:  #1e293b;
  --c-border:       rgba(255,255,255,.1);
  --c-border-soft:  rgba(255,255,255,.06);
  --c-ink:          #f1f5f9;
  --c-ink-mid:      #e2e8f0;
  --c-ink-soft:     #94a3b8;
  --c-muted:        #64748b;
  --c-muted-light:  #475569;
  --c-white:        #1e293b;
  --c-green-subtle: #0f2d1f;
  --c-green-hover:  #0f2d1f;
  --c-gold-bg:      #1c1506;
  --c-danger-bg:    #1c0606;
  --c-success-bg:   #061c0f;
  --c-warn-bg:      #1c1003;
  --shadow-xs:  0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.2);
  --shadow-md:  0 4px 20px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.2);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.25);
}
[data-theme="dark"] body { background: #0f172a; color: #f1f5f9; }
[data-theme="dark"] .app-card,
[data-theme="dark"] .section,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .pricing-card,
[data-theme="dark"] .entry-card,
[data-theme="dark"] .article-card { background: #1e293b; border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .data-table th { background: #0f172a; color: #94a3b8; }
[data-theme="dark"] .data-table td { border-color: rgba(255,255,255,.06); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0f172a;
  border-color: rgba(255,255,255,.12);
  color: #f1f5f9;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #475569; }
[data-theme="dark"] .page-tools-bar { background: #0f172a; border-color: rgba(255,255,255,.07); }
[data-theme="dark"] header { background: rgba(15,23,42,.92); border-color: rgba(255,255,255,.07); }
[data-theme="dark"] .nav-dropdown { background: #1e293b; border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .tag-badge { background: rgba(255,255,255,.08); color: #94a3b8; }
[data-theme="dark"] .ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #f1f5f9; }
[data-theme="dark"] .ghost:hover { background: rgba(255,255,255,.1); }
[data-theme="dark"] .btn-neon { background: rgba(0,229,160,.15); }

/* Theme Toggle Button */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: none;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.theme-toggle:hover { background: var(--c-surface-mid); color: var(--c-ink); }
.theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark  { display: none; }
[data-theme="dark"] .theme-icon-light { display: block; }
[data-theme="dark"] .theme-toggle { color: #94a3b8; border-color: rgba(255,255,255,.12); }
[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,.07); color: #f1f5f9; }

/* ─── Search Live ────────────────────────────────────────────────────────── */
.search-live-wrap {
  margin-top: 20px;
  background: var(--c-white, #fff);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: fadeUp .18s ease;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.search-live-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
}
.search-live-label { font-size: 0.75rem; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .07em; flex-shrink: 0; }
.search-cat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.search-cat-chip {
  padding: 3px 10px; font-size: 0.75rem; font-weight: 600;
  border-radius: 20px; border: 1px solid var(--c-border);
  background: var(--c-surface-mid); color: var(--c-ink-soft);
  cursor: pointer; transition: all .15s;
}
.search-cat-chip:hover, .search-cat-chip.is-active {
  background: var(--c-green); color: #fff; border-color: var(--c-green);
}
.search-live-results { display: flex; flex-direction: column; }
.search-live-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border-soft);
  cursor: pointer; transition: background .12s;
  text-align: left; background: none; border-left: none; border-right: none; border-top: none;
  width: 100%;
}
.search-live-item:last-child { border-bottom: none; }
.search-live-item:hover { background: var(--c-surface-mid); }
.search-live-item-title { font-size: 0.9rem; font-weight: 600; color: var(--c-ink); flex: 1; text-align: left; }
.search-live-item-title mark { background: rgba(5,150,105,.15); color: var(--c-green); border-radius: 2px; padding: 0 2px; }
.search-live-item-cat { font-size: 0.72rem; color: var(--c-muted); flex-shrink: 0; }
.search-live-item-score { font-size: 0.72rem; color: var(--c-muted-light); flex-shrink: 0; }
.search-live-empty { padding: 20px 16px; color: var(--c-muted); font-size: 0.88rem; text-align: center; }
.search-live-spinner { padding: 20px 16px; display: flex; justify-content: center; }
.search-live-spinner::after {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--c-border); border-top-color: var(--c-green);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Highlight in standard results */
.entry-card mark, .article-card mark { background: rgba(5,150,105,.12); color: var(--c-green); border-radius: 2px; }

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-surface);
  color: var(--c-ink);
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open { overflow: hidden; touch-action: none; }

/* Ensure [hidden] always wins over CSS display rules */
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--c-green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 999;
  padding: 10px 20px;
  background: var(--c-green);
  color: #fff;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 600;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 0; }

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Sans', ui-sans-serif, sans-serif;
  font-weight: 700;
  line-height: 1.12;
  color: var(--c-ink);
  overflow-wrap: anywhere;
}
h1 { margin: 0 0 16px; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.06; }
h2 { margin: 0 0 12px; font-size: clamp(1.5rem, 2.5vw, 2.4rem); line-height: 1.1; }
h3 { margin: 0 0 10px; font-size: 1.2rem; }
h4 { margin: 0 0 8px; font-size: 1rem; }
p { margin: 0 0 14px; overflow-wrap: anywhere; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  color: var(--c-green-mid);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.text-muted { color: var(--c-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.78rem; }
.text-lg { font-size: 1.125rem; }
.lead { font-size: 1.05rem; color: var(--c-muted); line-height: 1.75; }

/* ─── Layout Shell ───────────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.app-main { flex: 1; }

.page-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.app-page { display: none; }
.app-page.is-active { display: block; }

/* ─── Site Header ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 var(--content-pad);
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}
.brand img { height: 36px; width: auto; display: block; object-fit: contain; }
.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-ink);
  white-space: nowrap;
  letter-spacing: -0.01em;
  display: none;
}
@media (min-width: 1100px) { .brand-name { display: block; } }

/* Header Divider */
.header-divider {
  width: 1px;
  height: 24px;
  background: var(--c-border);
  margin: 0 20px 0 16px;
  flex-shrink: 0;
  display: none;
}
@media (min-width: 1100px) { .header-divider { display: block; } }

/* ─── Main Navigation ────────────────────────────────────────────────────── */
.top-nav {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.nav-group { position: relative; }

.top-nav > button,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-muted);
  padding: 7px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
  cursor: pointer;
}

.top-nav > button:hover,
.nav-trigger:hover {
  background: var(--c-green-hover);
  color: var(--c-green);
}

.top-nav button.is-current,
.top-nav > button.is-current {
  color: var(--c-green);
  font-weight: 600;
  background: var(--c-green-hover);
}

/* Chevron arrow on dropdown triggers */
.nav-trigger::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.5;
  transition: transform var(--t-fast), opacity var(--t-fast);
  margin-left: 1px;
}
.nav-group.is-expanded > .nav-trigger::after { transform: rotate(180deg); opacity: 0.8; }

/* ─── Mega Menus ─────────────────────────────────────────────────────────── */
.mega-menu {
  position: fixed;
  top: calc(var(--header-h) + 6px);
  z-index: var(--z-dropdown);
  display: none;
  width: min(960px, calc(100vw - 32px));
  grid-template-columns: minmax(240px, 1.3fr) repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
}

.nav-wide .mega-menu {
  left: 50%;
  transform: translateX(-50%);
}

.nav-compact .mega-menu {
  right: var(--content-pad);
  left: auto;
  transform: none;
  width: min(300px, calc(100vw - 32px));
  grid-template-columns: 1fr;
}

.nav-group:focus-within .mega-menu,
.nav-group.is-open .mega-menu,
.nav-group.is-expanded .mega-menu {
  display: grid;
}

/* Mega Section */
.mega-section {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border-soft);
}

.mega-section > span {
  color: var(--c-green);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.mega-section h3 {
  margin: 0 0 4px;
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--c-ink);
}

.mega-section p {
  margin: 0 0 8px;
  color: var(--c-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.mega-feature {
  background: linear-gradient(135deg, var(--c-white) 0%, var(--c-green-hover) 100%);
  border: 1px solid rgba(22,101,52,.12);
  border-left: 3px solid var(--c-green-mid);
}

/* Mega Menu Item Buttons */
.mega-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--c-ink-soft);
  padding: 7px 10px;
  font-size: 0.85rem;
  font-weight: 400;
  white-space: normal;
  transition: background var(--t-fast), color var(--t-fast);
  cursor: pointer;
}

.mega-menu button:hover {
  background: var(--c-green-hover);
  color: var(--c-green);
}

/* ─── Auth Panel ─────────────────────────────────────────────────────────── */
.auth-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 16px;
}

#sessionBadge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User/Admin Dropdowns in Header */
.header-dropdown {
  position: relative;
}
.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-dropdown);
  min-width: 220px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
}
.header-dropdown:focus-within .header-dropdown-menu,
.header-dropdown.is-open .header-dropdown-menu { display: block; }

.header-dropdown-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 0.875rem;
  color: var(--c-ink);
  cursor: pointer;
  transition: background var(--t-fast);
}
.header-dropdown-menu button:hover { background: var(--c-surface-mid); }
.header-dropdown-menu .dropdown-section-label {
  padding: 8px 12px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-muted-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.header-dropdown-menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--c-border); }

/* Login switch (for Admin Nav) */
.login-switch {
  display: grid;
  gap: 3px;
  min-width: 200px;
  margin: 0;
  color: var(--c-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ─── Mobile Menu ────────────────────────────────────────────────────────── */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-white);
  color: var(--c-ink);
  margin-left: auto;
  transition: background var(--t-fast);
}
.mobile-menu-toggle:hover { background: var(--c-surface-mid); }
.mobile-menu-toggle svg { width: 20px; height: 20px; }

.header-search-button { display: none; }

/* ─── Responsive: Mobile Nav ─────────────────────────────────────────────── */
@media (max-width: 1099px) {
  .mobile-menu-toggle { display: flex; }
  .auth-panel { display: none; }
  .header-divider { display: none; }

  .top-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 16px 16px 24px;
    background: var(--c-white);
    border-top: 1px solid var(--c-border);
    overflow-y: auto;
    z-index: var(--z-overlay);
    display: none;
    box-shadow: none;
  }

  .top-nav.is-open { display: flex; }
  .nav-group { width: 100%; }

  .nav-trigger,
  .top-nav > button {
    width: 100%;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--r-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-ink);
  }

  .mega-menu,
  .nav-wide .mega-menu,
  .nav-compact .mega-menu {
    position: static;
    width: 100%;
    transform: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 4px 0 4px 12px;
    background: transparent;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .nav-group.is-expanded .mega-menu { display: grid !important; }

  .mega-section {
    background: var(--c-surface);
    border-radius: var(--r-md);
    padding: 10px;
    border: 1px solid var(--c-border-soft);
  }

  .nav-mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 0 0;
    margin-top: auto;
    border-top: 1px solid var(--c-border);
  }

  .nav-mobile-auth button {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--r-md);
  }
}

@media (min-width: 1100px) { .nav-mobile-auth { display: none; } }

.nav-mobile-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 8px;
}
.nav-mobile-user button {
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-ink);
  cursor: pointer;
}
.nav-mobile-user button:hover { background: var(--c-surface-mid); }

/* ─── Sub-Navigation / Breadcrumb Bar ───────────────────────────────────── */
.page-tools-bar {
  position: sticky;
  top: var(--header-h);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--content-pad);
  border-bottom: 1px solid var(--c-border);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--c-muted-light);
  flex-wrap: wrap;
}
.breadcrumb button {
  background: transparent;
  border: 0;
  color: var(--c-muted-light);
  font-size: 0.8rem;
  padding: 0;
  cursor: pointer;
  transition: color var(--t-fast);
}
.breadcrumb button:hover { color: var(--c-green); }
.breadcrumb-sep { opacity: 0.4; }

/* Page Sidebar Container */
.with-sidebar {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0;
  min-height: calc(100vh - var(--header-h));
  align-items: start;
}

.page-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--c-border);
  background: var(--c-white);
  padding: 20px 0;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 8px;
}
.sidebar-label {
  padding: 6px 12px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--c-muted-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  color: var(--c-muted);
  font-size: 0.875rem;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-link:hover { background: var(--c-surface-mid); color: var(--c-ink); }
.sidebar-link.is-active {
  background: var(--c-green-hover);
  color: var(--c-green);
  font-weight: 600;
}
.sidebar-link svg { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }
.sidebar-link.is-active svg { opacity: 1; }
.sidebar-hr { margin: 8px 12px; border: 0; border-top: 1px solid var(--c-border); }

@media (max-width: 900px) {
  .with-sidebar {
    grid-template-columns: 1fr;
  }
  .page-sidebar { display: none; }
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn, .primary, .secondary, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base), box-shadow var(--t-base), opacity var(--t-fast);
  text-decoration: none;
}
.btn:disabled, .primary:disabled, .secondary:disabled, .ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn-primary, .primary {
  background: var(--c-green);
  color: #fff;
  border-color: var(--c-green);
  box-shadow: 0 1px 3px rgba(22,101,52,.25);
}
.btn-primary:hover, .primary:hover {
  background: var(--c-green-mid);
  border-color: var(--c-green-mid);
  box-shadow: 0 4px 12px rgba(22,101,52,.3);
}

/* Secondary */
.btn-secondary, .secondary {
  background: var(--c-ink);
  color: #fff;
  border-color: var(--c-ink);
}
.btn-secondary:hover, .secondary:hover {
  background: var(--c-ink-soft);
  border-color: var(--c-ink-soft);
}

/* Ghost danger variant */
.ghost.danger { color: var(--c-danger); border-color: var(--c-danger); }
.ghost.danger:hover { background: rgba(239,68,68,0.08); }

/* Ghost */
.btn-ghost, .ghost {
  background: transparent;
  color: var(--c-ink-soft);
  border-color: var(--c-border);
}
.btn-ghost:hover, .ghost:hover {
  background: var(--c-surface-mid);
  border-color: var(--c-muted-light);
  color: var(--c-ink);
}

/* Gold / Premium */
.btn-gold {
  background: linear-gradient(135deg, #b45309 0%, #ca8a04 100%);
  color: #fff;
  border-color: #b45309;
  box-shadow: 0 2px 8px rgba(180,83,9,.25);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
  box-shadow: 0 4px 16px rgba(180,83,9,.35);
}

/* Danger */
.btn-danger {
  background: var(--c-danger);
  color: #fff;
  border-color: var(--c-danger);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* Success */
.btn-success {
  background: var(--c-success);
  color: #fff;
  border-color: var(--c-success);
}

/* Icon Button */
.btn-icon {
  padding: 9px;
  width: 38px;
  height: 38px;
}
.btn-icon svg { width: 18px; height: 18px; }

/* Button sizes */
.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: var(--r-sm); }
.btn-lg { padding: 13px 28px; font-size: 1rem; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-green { background: var(--c-green-light); color: var(--c-green); }
.badge-gold  { background: var(--c-gold-light); color: var(--c-gold); }
.badge-ok    { background: var(--c-success-bg); color: var(--c-success); }
.badge-warn  { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-danger{ background: var(--c-danger-bg); color: var(--c-danger); }
.badge-gray  { background: var(--c-surface-mid); color: var(--c-muted); }
.badge-ink   { background: var(--c-ink); color: #fff; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */

/* Base card */
.card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 24px;
}

/* Standard Admin Card */
.admin-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}
.admin-card.wide { grid-column: 1 / -1; }

/* Stat Card (Dashboard) */
.stat-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1;
}
.stat-card-label {
  font-size: 0.8rem;
  color: var(--c-muted);
  font-weight: 500;
}
.stat-card-trend {
  font-size: 0.78rem;
  color: var(--c-success);
  font-weight: 600;
}

/* Feature Card */
.feature-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
  cursor: pointer;
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(22,101,52,.2);
  transform: translateY(-2px);
}
.feature-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--c-green-hover);
  color: var(--c-green);
  flex-shrink: 0;
}
.feature-card-icon svg { width: 20px; height: 20px; }
.feature-card h3 { margin: 0; font-size: 1rem; }
.feature-card p { margin: 0; font-size: 0.85rem; color: var(--c-muted); line-height: 1.55; }

/* Knowledge / Entry Card */
.knowledge-card, .article-card, .ticket-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow var(--t-base), border-color var(--t-base);
  text-align: left;
  width: 100%;
}
.knowledge-card:hover, .article-card:hover, .ticket-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: rgba(22,101,52,.18);
}
.knowledge-card h3 { font-size: 0.975rem; font-weight: 600; margin: 0; color: var(--c-ink); }
.knowledge-card .card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.knowledge-card p { font-size: 0.85rem; color: var(--c-muted); margin: 0; line-height: 1.5; }

/* Course Card */
.course-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t-base), border-color var(--t-base);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.course-card:hover { box-shadow: var(--shadow-md); border-color: rgba(22,101,52,.2); }
.course-card-header {
  padding: 20px;
  background: linear-gradient(135deg, var(--c-green-hover) 0%, var(--c-surface) 100%);
  border-bottom: 1px solid var(--c-border);
}
.course-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.course-card h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.course-card p { font-size: 0.83rem; color: var(--c-muted); margin: 0; }

/* Auto Page Card (quick-nav cards) */
.auto-page-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
  width: 100%;
}
.auto-page-card:hover {
  background: var(--c-green-hover);
  border-color: rgba(22,101,52,.25);
  box-shadow: var(--shadow-xs);
}
.auto-page-card span { font-size: 0.9rem; font-weight: 600; color: var(--c-ink); }
.auto-page-card small { font-size: 0.78rem; color: var(--c-muted); }

/* Premium Card */
.premium-card {
  background: linear-gradient(135deg, var(--c-ink) 0%, var(--c-ink-soft) 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-xl);
  padding: 32px;
  color: #fff;
}
.premium-card .eyebrow { color: var(--c-gold-mid); }
.premium-card h2, .premium-card h3 { color: #fff; }
.premium-card p { color: rgba(255,255,255,.75); }

/* Warning Card */
.warning-card {
  background: var(--c-warn-bg);
  border: 1px solid rgba(217,119,6,.2);
  border-left: 3px solid var(--c-warn);
  border-radius: var(--r-md);
  padding: 16px 20px;
}

/* Detail/Article Card */
.detail-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: clamp(24px, 4vw, 48px);
  box-shadow: var(--shadow-sm);
}
.detail-card .lead {
  color: var(--c-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 72ch;
}

/* Command panel */
.command-panel {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

/* Editor card */
.editor-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
}

/* Plan output */
.plan-output {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
}

.advisor-box {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
}

/* ─── Grid Layouts ───────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.cards-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cards-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.article-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ticket-list  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.page-grid    { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.content-grid, .ticket-layout, .split-section, .advisor, .admin-grid, .detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}
.detail-layout { grid-template-columns: minmax(0, 1fr) 300px; }

@media (max-width: 900px) {
  .cards-grid-2, .cards-grid-3, .cards-grid-4,
  .article-list, .ticket-list, .page-grid,
  .content-grid, .ticket-layout, .split-section, .advisor, .admin-grid, .detail-layout {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 600px) and (max-width: 900px) {
  .page-grid { grid-template-columns: repeat(2, 1fr); }
  .article-list { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Section & Page Structure ───────────────────────────────────────────── */
.section {
  padding: clamp(40px, 6vw, 80px) var(--content-pad);
}

.section-heading {
  margin-bottom: 32px;
}
.section-heading h2 { margin-bottom: 8px; }
.section-heading p { color: var(--c-muted); max-width: 60ch; }

/* Page Header (inside each app page) */
.page-header {
  padding: 32px var(--content-pad) 0;
  max-width: var(--content-max);
  margin: 0 auto;
}
.page-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header-title { display: flex; flex-direction: column; gap: 4px; }
.page-header-title h1 { margin: 0; font-size: clamp(1.4rem, 2.5vw, 2rem); }
.page-header-title p { margin: 0; color: var(--c-muted); font-size: 0.875rem; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Content area within a page */
.page-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad) 48px;
}

/* ─── Hero Section ───────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.8fr);
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  padding: clamp(40px, 6vw, 80px) var(--content-pad);
  max-width: var(--content-max);
  margin: 0 auto;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 40px;
  }
  .hero .command-panel { display: none; }
}

.hero-copy { max-width: 680px; }
.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero p { font-size: 1.05rem; color: var(--c-muted); line-height: 1.75; max-width: 52ch; }
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.hero-search {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  max-width: 620px;
}
.hero-search input { flex: 1; min-width: 0; }

/* Hero gradient background */
.hero-section {
  background: linear-gradient(160deg, #fff 0%, #f8fdf9 55%, #f0fdf4 100%);
  border-bottom: 1px solid var(--c-border);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(180,83,9,.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Feature Band ───────────────────────────────────────────────────────── */
.feature-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}
.feature-band article {
  padding: 28px 24px;
  border-right: 1px solid var(--c-border);
  transition: background var(--t-base);
}
.feature-band article:last-child { border-right: 0; }
.feature-band article:hover { background: var(--c-green-hover); }
.feature-band strong { display: block; font-size: 0.8rem; font-weight: 700; color: var(--c-green); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.feature-band h3 { margin: 0 0 6px; font-size: 1.05rem; }
.feature-band p { color: var(--c-muted); line-height: 1.6; font-size: 0.875rem; margin: 0; }

@media (max-width: 900px) {
  .feature-band { grid-template-columns: repeat(2, 1fr); }
  .feature-band article { border-bottom: 1px solid var(--c-border); }
}
@media (max-width: 500px) {
  .feature-band { grid-template-columns: 1fr; }
}

/* ─── Forms & Inputs ─────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-white);
  color: var(--c-ink);
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--c-muted-light); }
textarea { resize: vertical; min-height: 90px; }

input:focus, select:focus, textarea:focus {
  border-color: var(--c-green-mid);
  box-shadow: 0 0 0 3px rgba(21,128,61,.12);
}

label { display: block; font-size: 0.83rem; font-weight: 600; color: var(--c-ink); margin-bottom: 4px; }
label input, label select, label textarea { margin-top: 4px; }

.form-row { display: grid; gap: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ─── Search Box ─────────────────────────────────────────────────────────── */
.global-search {
  display: flex;
  gap: 8px;
  margin: 0 0 0 auto;
  width: min(520px, 100%);
}
.global-search input { flex: 1; min-width: 0; }

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 640px;
}
.search-box input { flex: 1; min-width: 0; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--c-border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--c-surface);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-ink);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--c-surface); }

/* ─── Auth ───────────────────────────────────────────────────────────────── */
.auth-layout { display: grid; place-items: center; min-height: calc(100vh - var(--header-h)); padding: 40px 16px; }
.auth-card {
  width: min(480px, 100%);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 36px;
}
.auth-card h2 { margin-bottom: 4px; }
.auth-card > p { color: var(--c-muted); margin-bottom: 24px; }
.auth-card form { display: grid; gap: 16px; }
.auth-card .btn { width: 100%; margin-top: 4px; }
.auth-toggle { text-align: center; margin-top: 20px; font-size: 0.875rem; color: var(--c-muted); }
.auth-toggle button { background: none; border: none; color: var(--c-green); font-weight: 600; cursor: pointer; padding: 0; }
.form-status { color: var(--c-green); font-weight: 600; font-size: 0.875rem; margin-top: 4px; }
.form-status.error { color: var(--c-danger); }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.pager button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  background: var(--c-white);
  color: var(--c-muted);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.pager button:hover { background: var(--c-green-hover); color: var(--c-green); border-color: rgba(22,101,52,.2); }
.pager button.is-current { background: var(--c-green); color: #fff; border-color: var(--c-green); font-weight: 700; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Empty / Loading / Error States ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--c-muted);
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.3; margin: 0 auto 16px; display: block; }
.empty-state h3 { font-size: 1.05rem; color: var(--c-ink-soft); margin-bottom: 6px; }
.empty-state p { font-size: 0.875rem; max-width: 36ch; margin: 0 auto; }

.loading-shimmer {
  background: linear-gradient(90deg, var(--c-surface) 25%, var(--c-surface-mid) 50%, var(--c-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.error-banner {
  background: var(--c-danger-bg);
  border: 1px solid rgba(220,38,38,.2);
  border-left: 3px solid var(--c-danger);
  border-radius: var(--r-md);
  color: var(--c-danger);
  padding: 14px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.success-banner {
  background: var(--c-success-bg);
  border: 1px solid rgba(22,163,74,.2);
  border-left: 3px solid var(--c-success);
  border-radius: var(--r-md);
  color: var(--c-success);
  padding: 14px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
}

/* ─── Detail / Article Content ───────────────────────────────────────────── */
.detail-section { margin: 28px 0; }

.entry-cover {
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 24px;
  max-height: 320px;
}
.entry-cover img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  filter: brightness(.92) saturate(1.1);
}
/* Logo fallback when a cover image fails to load: contain it on a dark backdrop */
.entry-cover img.entry-cover-logo {
  object-fit: contain;
  background: var(--c-hero-bg, #0b1f17);
  padding: 40px;
  filter: none;
}

.security-box {
  background: #fff7ed;
  border: 1.5px solid #f97316;
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 20px 0;
}
.security-box h3 { color: #c2410c; margin-bottom: 8px; }

.next-step-box {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 20px 0;
}
.next-step-box h3 { color: var(--c-green); margin-bottom: 6px; }

.highlight-box, .tips-box {
  background: var(--c-green-hover);
  border: 1px solid rgba(22,101,52,.12);
  border-left: 3px solid var(--c-green-mid);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 20px 0;
}
.highlight-box h3, .highlight-box h4, .tips-box h3, .tips-box h4 { color: var(--c-green); margin-bottom: 8px; font-size: 0.875rem; }

.gold-box {
  background: var(--c-gold-bg);
  border: 1px solid rgba(180,83,9,.15);
  border-left: 3px solid var(--c-gold);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 20px 0;
}

.exercise-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 20px;
  margin: 20px 0;
}

pre, code {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.875em;
}

.code-block {
  background: var(--c-ink-mid);
  color: #d4d4d4;
  border-radius: var(--r-md);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  line-height: 1.6;
}

code {
  background: var(--c-surface-mid);
  color: var(--c-green);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.step-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--c-border);
}
.step-card:last-child { border-bottom: 0; }
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-green);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.related-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--c-green);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  margin: 3px;
}
.related-link:hover { background: var(--c-green-hover); border-color: rgba(22,101,52,.25); }

/* ─── Entry Table of Contents ────────────────────────────────────────────── */
.entry-toc {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-green-mid);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 20px 0 28px;
  font-size: 0.875rem;
}
.entry-toc strong { display: block; margin-bottom: 10px; font-size: 0.85rem; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.entry-toc ol { margin: 0; padding-left: 20px; columns: 2; gap: 16px; }
.entry-toc li { margin: 3px 0; }
.entry-toc a { color: var(--c-green); text-decoration: none; }
.entry-toc a:hover { text-decoration: underline; }

/* ─── Step Cards ─────────────────────────────────────────────────────────── */
.step-list { display: flex; flex-direction: column; }
.step-card { display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--c-border); }
.step-card:last-child { border-bottom: 0; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--c-green); color: #fff; font-size: 0.875rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-body { padding-top: 5px; line-height: 1.6; }

/* ─── Tip Cards ──────────────────────────────────────────────────────────── */
.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(22,101,52,.1);
  line-height: 1.6;
}
.tip-card:last-child { border-bottom: 0; }
.tip-icon {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--c-green);
  background: rgba(22,101,52,.12);
  padding: 3px 6px;
  border-radius: 4px;
  margin-top: 2px;
  text-transform: uppercase;
}

/* ─── Exercise Cards ─────────────────────────────────────────────────────── */
.exercise-list { display: flex; flex-direction: column; gap: 10px; }
.exercise-card { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-sm); padding: 14px 16px; }
.exercise-num { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--c-gold); color: #fff; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.exercise-body { padding-top: 3px; line-height: 1.6; }

/* ─── Quiz / Kontrollfragen ──────────────────────────────────────────────── */
.quiz-list { display: flex; flex-direction: column; gap: 6px; }
.quiz-item { border: 1px solid var(--c-border); border-radius: var(--r-sm); overflow: hidden; }
.quiz-item summary { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 500; list-style: none; }
.quiz-item summary::-webkit-details-marker { display: none; }
.quiz-item summary::after { content: "+"; margin-left: auto; font-size: 1.1rem; color: var(--c-text-muted); flex-shrink: 0; }
.quiz-item[open] summary::after { content: "−"; }
.quiz-item summary:hover { background: var(--c-surface); }
.quiz-num { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--c-surface-mid); font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; color: var(--c-text-muted); margin-top: 1px; }
.quiz-answer { padding: 12px 14px 14px 46px; background: var(--c-green-hover); border-top: 1px solid var(--c-border); font-size: 0.9rem; line-height: 1.6; }
.quiz-answer p { margin: 4px 0; }
.quiz-explanation { color: var(--c-text-muted); font-size: 0.875rem; }
.quiz-q-text { flex: 1; }
.quiz-badge { flex-shrink: 0; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; margin-top: 2px; }
.quiz-badge--anfänger { background: #dcfce7; color: #166534; }
.quiz-badge--fortgeschritten { background: #fef9c3; color: #854d0e; }
.quiz-badge--profi { background: #fee2e2; color: #991b1b; }

/* ─── Progress Bar ───────────────────────────────────────────────────────── */
progress, .progress-bar {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 100px;
  background: var(--c-border);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--c-border); border-radius: 100px; }
progress::-webkit-progress-value { background: var(--c-green); border-radius: 100px; }
progress::-moz-progress-bar { background: var(--c-green); border-radius: 100px; }

/* ─── Accordion ──────────────────────────────────────────────────────────── */
.accordion-item { border: 1px solid var(--c-border); border-radius: var(--r-md); margin-bottom: 8px; overflow: hidden; }
.accordion-trigger {
  width: 100%;
  text-align: left;
  background: var(--c-white);
  border: 0;
  padding: 16px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--t-fast);
}
.accordion-trigger:hover { background: var(--c-surface); }
.accordion-content { padding: 16px 20px; border-top: 1px solid var(--c-border); font-size: 0.875rem; color: var(--c-muted); line-height: 1.65; }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tab-list {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px;
  border: 0;
  background: transparent;
  color: var(--c-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab-btn:hover { color: var(--c-ink); }
.tab-btn.is-active { color: var(--c-green); border-bottom-color: var(--c-green); font-weight: 600; }

/* ─── Status Dot ─────────────────────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.status-dot.green { background: var(--c-success); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.status-dot.yellow { background: var(--c-warn); }
.status-dot.red { background: var(--c-danger); }
.status-dot.gray { background: var(--c-muted-light); }

/* ─── Metric Grid ────────────────────────────────────────────────────────── */
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.metric-grid div { padding: 16px; border-radius: var(--r-md); background: var(--c-surface); border: 1px solid var(--c-border); }
.metric-grid strong { display: block; font-size: 1.8rem; font-weight: 700; color: var(--c-ink); }
.metric-grid span { color: var(--c-muted); font-size: 0.83rem; }

.auto-feed {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--c-gold);
  background: var(--c-gold-bg);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--c-ink-soft);
}

/* ─── Panel Top ──────────────────────────────────────────────────────────── */
.panel-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-muted);
  font-weight: 600;
  font-size: 0.875rem;
}

/* ─── Admin Layout ───────────────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--header-h));
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--c-border);
  background: var(--c-white);
  padding: 16px 0;
}

.admin-content {
  padding: 28px var(--content-pad);
  max-width: 100%;
  overflow: hidden;
}

/* Admin grid */
.admin-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; display: grid; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

/* Admin Sections (hidden/shown via JS) */
.admin-sub { display: none; }
.admin-sub.is-active { display: block; }
.admin-sub-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-sub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* ─── Pricing ────────────────────────────────────────────────────────────── */
/* ─── Billing toggle ────────────────────────────────────────────────────── */
.billing-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--c-muted);
}
.save-label {
  font-size: 0.78rem;
  background: rgba(0,200,120,.15);
  color: var(--c-green);
  border-radius: 20px;
  padding: 2px 8px;
  font-style: normal;
  font-weight: 600;
}
.billing-toggle-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.billing-toggle-label input { opacity: 0; width: 0; height: 0; }
.billing-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--c-border);
  border-radius: 24px;
  transition: background 0.2s;
}
.billing-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.billing-toggle-label input:checked + .billing-toggle-slider { background: var(--c-green-mid); }
.billing-toggle-label input:checked + .billing-toggle-slider::before { transform: translateX(20px); }

/* ─── Pricing ──────────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.pricing-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow var(--t-base);
  position: relative;
}
.pricing-card:hover { box-shadow: var(--shadow-md); }
.pricing-card--featured {
  border-color: var(--c-green-mid);
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(0,200,120,.08);
}
.pricing-card--current { border-color: var(--c-green); }
.plan-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 20px;
  padding: 3px 10px;
  align-self: flex-start;
}
.plan-badge.current  { background: rgba(0,200,120,.15); color: var(--c-green); }
.plan-badge.popular  { background: rgba(0,140,255,.12); color: #0078d4; }
.plan-badge.cancel   { background: rgba(255,80,80,.12); color: #c0392b; }
.plan-save-badge {
  display: inline-block;
  float: right;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0,200,120,.15);
  color: var(--c-green);
  border-radius: 20px;
  padding: 3px 8px;
}
.pricing-plan-name { font-size: 0.8rem; font-weight: 700; color: var(--c-green); text-transform: uppercase; letter-spacing: 0.08em; }
.pricing-price { font-size: 2rem; font-weight: 800; color: var(--c-ink); line-height: 1.2; }
.pricing-price small, .pricing-price br + small { font-size: 0.85rem; font-weight: 400; color: var(--c-muted); display: block; margin-top: 2px; }
.pricing-features { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; flex: 1; }
.pricing-features li { display: flex; gap: 8px; font-size: 0.875rem; color: var(--c-muted); }
.pricing-features li::before { content: '✓'; color: var(--c-green); font-weight: 700; flex-shrink: 0; }
.pricing-note { text-align: center; color: var(--c-muted-light); font-size: 0.83rem; margin-top: 8px; }
.plan-cancel-note { font-size: 0.8rem; color: #c0392b; margin: 0; }

/* ─── Lesson / Quiz ──────────────────────────────────────────────────────── */
.lesson-wrap {
  max-width: 860px;
  margin: 0 auto;
}
.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--c-border);
  margin-top: 24px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  font-size: 0.9rem;
}
.quiz-option:hover { background: var(--c-green-hover); border-color: rgba(22,101,52,.2); }
.quiz-option.is-correct { background: var(--c-success-bg); border-color: var(--c-success); color: var(--c-success); }
.quiz-option.is-wrong { background: var(--c-danger-bg); border-color: var(--c-danger); color: var(--c-danger); }

/* ─── Community / Contribution ───────────────────────────────────────────── */
.contribution-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contribution-card h4 { margin: 0; font-size: 0.95rem; }
.contribution-card p { margin: 0; font-size: 0.83rem; color: var(--c-muted); }
.contribution-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contribution-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* ─── Ticket ─────────────────────────────────────────────────────────────── */
.ticket-card h3 { font-size: 0.95rem; font-weight: 600; margin: 0; }
.ticket-card p { font-size: 0.83rem; color: var(--c-muted); margin: 0; }
.ticket-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ─── Admin Quality Center ───────────────────────────────────────────────── */
.aq-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 28px; }
.aq-stat { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.aq-val { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.aq-lbl { font-size: 0.75rem; color: var(--c-text-muted); }
.aq-stat--excellent .aq-val { color: #16a34a; }
.aq-stat--good .aq-val { color: #65a30d; }
.aq-stat--warn .aq-val { color: #d97706; }
.aq-stat--danger .aq-val { color: #dc2626; }
.aq-stat--avg .aq-val { color: var(--c-green); }

.aq-panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 20px 24px; margin-bottom: 20px; }
.aq-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.aq-panel-header h3 { margin: 0; }
.aq-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.aq-empty { color: var(--c-text-muted); margin: 0; }

.aq-audit-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.aq-audit-stat { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--r-sm); padding: 12px 16px; text-align: center; min-width: 90px; }
.aq-audit-stat strong { display: block; font-size: 1.4rem; font-weight: 800; }
.aq-audit-stat span { font-size: 0.72rem; color: var(--c-text-muted); }
.aq-audit-stat--danger strong { color: #dc2626; }
.aq-audit-stat--warn strong { color: #d97706; }
.aq-audit-stat--mid strong { color: #ca8a04; }
.aq-audit-stat--low strong { color: #65a30d; }
.aq-audit-stat--ok strong { color: #16a34a; }

.aq-audit-list { display: flex; flex-direction: column; gap: 8px; }
.aq-audit-entry { border: 1px solid var(--c-border); border-radius: var(--r-sm); overflow: hidden; }
.aq-audit-entry--critical { border-left: 3px solid #dc2626; }
.aq-audit-entry--high { border-left: 3px solid #f97316; }
.aq-audit-entry--medium { border-left: 3px solid #ca8a04; }
.aq-audit-entry--low { border-left: 3px solid #65a30d; }
.aq-audit-entry-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--c-surface); flex-wrap: wrap; }
.aq-audit-entry-head strong { flex: 1; font-size: 0.9rem; }
.aq-score { font-size: 0.78rem; color: var(--c-text-muted); }
.aq-sev-badge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 4px; }
.aq-sev-badge--critical { background: #fee2e2; color: #991b1b; }
.aq-sev-badge--high { background: #ffedd5; color: #9a3412; }
.aq-sev-badge--medium { background: #fef9c3; color: #854d0e; }
.aq-sev-badge--low { background: #dcfce7; color: #166534; }
.aq-problems { margin: 0; padding: 8px 14px 10px 30px; font-size: 0.82rem; color: var(--c-text-muted); }
.aq-problems li { margin: 2px 0; }
.aq-more { font-size: 0.85rem; color: var(--c-text-muted); text-align: center; padding: 8px; }

/* ─── Generator ──────────────────────────────────────────────────────────── */
.gen-log {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  max-height: 360px;
  overflow-y: auto;
  background: var(--c-ink-mid);
  color: #d4d4d4;
  border-radius: var(--r-md);
  padding: 16px;
}
.gen-log .log-info  { color: #9ca3af; }
.gen-log .log-success{ color: #4ade80; }
.gen-log .log-warning{ color: #fbbf24; }
.gen-log .log-error { color: #f87171; }
.gen-log .log-skip  { color: #6b7280; }

.gen-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  flex-wrap: wrap;
}

/* ─── Assistant / Bot ────────────────────────────────────────────────────── */
.assistant-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--content-pad) 60px;
}

.assistant-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 24px;
}
.assistant-header-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--c-green-hover);
  border: 1px solid rgba(22,101,52,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-green);
  flex-shrink: 0;
}
.assistant-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.assistant-subtitle { color: var(--c-muted); font-size: 0.9rem; margin: 0; }

.assistant-quick-prompts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.quick-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--c-border);
  border-radius: 100px;
  background: var(--c-white);
  color: var(--c-muted);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.quick-prompt-btn:hover {
  background: var(--c-green-hover);
  border-color: rgba(22,101,52,.2);
  color: var(--c-green);
}

.assistant-chat { display: flex; flex-direction: column; gap: 0; }

.assistant-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-white);
  box-shadow: var(--shadow-xs);
}
.assistant-input-row textarea {
  flex: 1;
  border: 0;
  box-shadow: none;
  resize: none;
  padding: 4px 0;
  min-height: 24px;
  max-height: 120px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.assistant-input-row textarea:focus { box-shadow: none; }

.assistant-messages { display: flex; flex-direction: column; gap: 16px; margin-bottom: 8px; }

.assistant-msg {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
}
.assistant-msg.user {
  align-items: flex-end;
}
.assistant-msg.user .msg-bubble {
  background: var(--c-green);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  max-width: 72%;
  font-size: 0.9rem;
}
.assistant-msg.assistant .msg-bubble {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 4px 18px 18px 18px;
  padding: 16px 20px;
  max-width: 100%;
  font-size: 0.9rem;
  line-height: 1.65;
  box-shadow: var(--shadow-xs);
}

.assistant-loading { display: flex; align-items: center; gap: 6px; padding: 12px 16px; color: var(--c-muted); font-size: 0.85rem; }
.assistant-loading span { display: flex; gap: 4px; }
.assistant-loading span i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-muted-light);
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.assistant-loading span i:nth-child(2) { animation-delay: 0.2s; }
.assistant-loading span i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse { 0%, 60%, 100% { opacity: 0.3; transform: scale(1); } 30% { opacity: 1; transform: scale(1.2); } }

.assistant-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}
.assistant-action-badge.found { background: var(--c-success-bg); color: var(--c-success); }
.assistant-action-badge.created { background: var(--c-green-light); color: var(--c-green); }
.assistant-action-badge.improved { background: var(--c-gold-light); color: var(--c-gold); }
.assistant-action-badge.answered { background: var(--c-surface-mid); color: var(--c-muted); }

.assistant-entry-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.assistant-entry-card:hover { background: var(--c-green-hover); border-color: rgba(22,101,52,.2); }
.assistant-entry-card h4 { margin: 0 0 4px; font-size: 0.9rem; }
.assistant-entry-card p { margin: 0; font-size: 0.82rem; color: var(--c-muted); }

.assistant-related { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.assistant-plan-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-top: 10px;
}
.assistant-plan-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-green);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.assistant-plan-card h4 { margin: 0 0 4px; font-size: 0.95rem; }
.assistant-plan-card p { margin: 0 0 12px; font-size: 0.82rem; color: var(--c-muted); }
.assistant-plan-btn { font-size: 0.82rem; padding: 7px 16px; }

/* ─── System Health / Quality ────────────────────────────────────────────── */
.system-health-result { margin-top: 20px; }
.system-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }

/* ─── Source Cards ───────────────────────────────────────────────────────── */
.source-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.source-card h4 { margin: 0; font-size: 0.9rem; }
.source-card p { margin: 0; font-size: 0.82rem; color: var(--c-muted); }
.source-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.source-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ─── Learning / Course Detail ───────────────────────────────────────────── */
.course-progress-bar { height: 6px; background: var(--c-border); border-radius: 100px; overflow: hidden; }
.course-progress-fill { height: 100%; background: var(--c-green); border-radius: 100px; transition: width 0.4s ease; }

.module-accordion { border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; }
.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background var(--t-fast);
  font-size: 0.875rem;
}
.lesson-item:last-child { border-bottom: 0; }
.lesson-item:hover { background: var(--c-green-hover); }
.lesson-item.is-done { opacity: 0.7; }
.lesson-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
}
.lesson-check.done { background: var(--c-green); border-color: var(--c-green); color: #fff; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--c-hero-bg);
  border-top: 1px solid var(--c-hero-border);
  padding: 56px var(--content-pad) 0;
  color: rgba(255,255,255,.55);
  font-size: 0.875rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--c-hero-border);
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-logo-row { display: flex; align-items: center; gap: 10px; }
.footer-logo-row img { opacity: .9; flex-shrink: 0; }
.footer-brand-name { font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: -.01em; white-space: nowrap; }
.footer-tagline { margin: 0; line-height: 1.65; color: rgba(255,255,255,.45); font-size: 0.82rem; max-width: 280px; }
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0,229,160,.1);
  border: 1px solid rgba(0,229,160,.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: var(--c-neon);
  width: fit-content;
}
.footer-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-neon);
  box-shadow: 0 0 6px var(--c-neon);
  animation: footer-pulse 2s ease-in-out infinite;
}
@keyframes footer-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.35); margin: 0 0 4px;
  white-space: nowrap;
}
.footer-col nav { display: flex; flex-direction: column; gap: 2px; }
.footer-col nav button,
.footer-col nav a {
  background: none; border: none;
  color: rgba(255,255,255,.55);
  font-size: 0.875rem; cursor: pointer;
  padding: 6px 0; text-align: left; text-decoration: none;
  transition: color .15s; width: fit-content;
}
.footer-col nav button:hover,
.footer-col nav a:hover { color: var(--c-neon); }
.footer-bottom {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: var(--content-max); margin: 0 auto;
  padding: 18px 0; font-size: 0.78rem; color: rgba(255,255,255,.28);
}
.footer-bottom-sep { color: rgba(255,255,255,.15); }

/* ─── Legal pages ────────────────────────────────────────────────────────── */
.legal-notice {
  background: rgba(255, 180, 0, 0.12);
  border: 1px solid rgba(255, 180, 0, 0.35);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--c-text);
  margin-bottom: 20px;
}
.legal-content h2 { font-size: 1.1rem; margin: 24px 0 8px; color: var(--c-text); }
.legal-content h3 { font-size: 0.95rem; margin: 16px 0 6px; color: var(--c-text); }
.legal-content p, .legal-content li { font-size: 0.9rem; line-height: 1.65; color: var(--c-muted); }
.legal-content ul { padding-left: 20px; }
.legal-content a { color: var(--c-green-mid); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { justify-content: center; text-align: center; }
}

/* ─── Autogenerate Skeleton ─────────────────────────────────────────────── */
.autogen-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 64px 24px;
  text-align: center;
}
.autogen-spinner svg {
  animation: autospin 1.6s linear infinite;
}
@keyframes autospin { to { transform: rotate(360deg); } }
.autogen-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-ink);
  margin: 0;
}
.autogen-sub {
  color: var(--c-muted);
  margin: 0;
  font-size: 0.9rem;
  max-width: 320px;
  line-height: 1.6;
}
.autogen-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin-top: 12px;
}
.autogen-bar {
  height: 14px;
  background: linear-gradient(90deg, var(--c-border-soft) 25%, var(--c-border) 50%, var(--c-border-soft) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: autoshimmer 1.4s ease-in-out infinite;
}
.autogen-bar:nth-child(2) { animation-delay: .2s; }
.autogen-bar:nth-child(3) { animation-delay: .4s; }
.autogen-bar:nth-child(4) { animation-delay: .6s; }
@keyframes autoshimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── ITZI Chatbot ───────────────────────────────────────────────────────── */
.itzi-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Toggle button */
.itzi-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-hero-bg);
  border: 1.5px solid #00e5a0;
  border-radius: 50px;
  padding: 8px 16px 8px 8px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,229,160,.25), 0 2px 8px rgba(0,0,0,.4);
  transition: box-shadow .2s, transform .2s;
  color: #fff;
}
.itzi-toggle:hover {
  box-shadow: 0 6px 32px rgba(0,229,160,.4), 0 2px 12px rgba(0,0,0,.5);
  transform: translateY(-2px);
}
.itzi-toggle-icon { width: 40px; height: 40px; flex-shrink: 0; }
.itzi-toggle-label { font-size: 0.9rem; font-weight: 700; letter-spacing: .04em; color: #fff; }
.itzi-unread {
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  position: absolute;
  top: 2px; right: 2px;
}

/* Chat panel */
.itzi-panel {
  width: 360px;
  max-height: 560px;
  background: var(--c-hero-bg);
  border: 1px solid rgba(0,229,160,.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(0,229,160,.08);
  animation: itziSlideIn .2s ease;
}
@keyframes itziSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.itzi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: var(--c-hero-mid);
  flex-shrink: 0;
}
.itzi-header-info { display: flex; align-items: center; gap: 10px; }
.itzi-avatar { width: 32px; height: 32px; flex-shrink: 0; }
.itzi-header-name { margin: 0; font-size: 0.9rem; font-weight: 700; color: #fff; line-height: 1.2; }
.itzi-header-sub  { margin: 0; font-size: 0.72rem; color: var(--c-neon); line-height: 1.2; }
.itzi-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.4); padding: 4px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.itzi-close:hover { color: #fff; background: rgba(255,255,255,.08); }

/* Messages */
.itzi-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.itzi-messages::-webkit-scrollbar { width: 4px; }
.itzi-messages::-webkit-scrollbar-track { background: transparent; }
.itzi-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.itzi-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
}
.itzi-msg--bot { align-self: flex-start; }
.itzi-msg--user { align-self: flex-end; flex-direction: row-reverse; }

.itzi-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.55;
}
.itzi-msg--bot .itzi-msg-bubble {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  border-bottom-left-radius: 4px;
}
.itzi-msg--user .itzi-msg-bubble {
  background: rgba(0,229,160,.15);
  border: 1px solid rgba(0,229,160,.25);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Entry link inside bot message */
.itzi-entry-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--c-neon);
  background: rgba(0,229,160,.08);
  border: 1px solid rgba(0,229,160,.2);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .15s;
}
.itzi-entry-link:hover { background: rgba(0,229,160,.15); }

/* Related chips inside message */
.itzi-related { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.itzi-related-chip {
  font-size: 0.75rem;
  color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.itzi-related-chip:hover { color: var(--c-neon); background: rgba(0,229,160,.08); }

/* Typing indicator */
.itzi-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
}
.itzi-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-neon);
  animation: itziDot 1.2s ease-in-out infinite;
}
.itzi-typing span:nth-child(2) { animation-delay: .2s; }
.itzi-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes itziDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* Quick chips */
.itzi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.itzi-chip {
  font-size: 0.75rem;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.itzi-chip:hover { color: var(--c-neon); background: rgba(0,229,160,.08); border-color: rgba(0,229,160,.25); }

/* Input form */
.itzi-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: var(--c-hero-mid);
  flex-shrink: 0;
}
.itzi-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: border-color .15s;
}
.itzi-input::placeholder { color: rgba(255,255,255,.3); }
.itzi-input:focus { border-color: rgba(0,229,160,.4); }
.itzi-send {
  background: rgba(0,229,160,.15);
  border: 1px solid rgba(0,229,160,.3);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--c-neon);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
  display: flex; align-items: center;
}
.itzi-send:hover { background: rgba(0,229,160,.25); transform: scale(1.05); }
.itzi-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }

@media (max-width: 480px) {
  .itzi-widget { bottom: 16px; right: 16px; }
  .itzi-panel { width: calc(100vw - 32px); max-height: 70vh; }
}

/* ─── ITZI Full Chat Page ────────────────────────────────────────────────── */
#page-itzi { padding: 0; overflow: hidden; }
.itzi-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: calc(100vh - 112px); /* subtract header+toolbar */
  background: var(--c-hero-bg);
}

/* Sidebar */
.itzi-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--c-hero-mid);
  border-right: 1px solid rgba(255,255,255,.07);
  overflow: hidden;
}
.itzi-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.itzi-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}
.itzi-new-chat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,229,160,.12);
  border: 1px solid rgba(0,229,160,.25);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--c-neon);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  width: 100%;
  justify-content: center;
}
.itzi-new-chat:hover { background: rgba(0,229,160,.22); }

.itzi-sidebar-section { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.05); flex-shrink: 0; }
.itzi-convlist-section { flex: 1; overflow-y: auto; border-bottom: none; }
.itzi-convlist-section::-webkit-scrollbar { width: 3px; }
.itzi-convlist-section::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

.itzi-sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.3);
  margin: 0 0 10px;
}
.itzi-capability-chips { display: flex; flex-direction: column; gap: 4px; }
.itzi-cap-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  text-align: left;
  transition: background .15s, color .15s;
}
.itzi-cap-chip:hover { background: rgba(255,255,255,.07); color: var(--c-neon); }

/* Conversation list */
.itzi-conv-list { display: flex; flex-direction: column; gap: 2px; }
.itzi-conv-empty { color: rgba(255,255,255,.3); font-size: 0.8rem; margin: 0; }
.itzi-conv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  color: rgba(255,255,255,.65);
  font-size: 0.82rem;
}
.itzi-conv-item:hover, .itzi-conv-item.is-active { background: rgba(255,255,255,.08); color: #fff; }
.itzi-conv-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.itzi-conv-item-del {
  background: none; border: none; color: rgba(255,255,255,.2); cursor: pointer;
  padding: 2px; border-radius: 4px; opacity: 0; transition: opacity .15s, color .15s; flex-shrink: 0;
  display: flex; align-items: center;
}
.itzi-conv-item:hover .itzi-conv-item-del { opacity: 1; }
.itzi-conv-item-del:hover { color: #ef4444; }

/* Sidebar footer */
.itzi-sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.itzi-user-info {
  font-size: 0.78rem;
  color: rgba(255,255,255,.4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.itzi-user-plan-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--c-neon);
  background: rgba(0,229,160,.1);
  border: 1px solid rgba(0,229,160,.2);
  border-radius: 10px;
  padding: 2px 7px;
}

/* Main area */
.itzi-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Welcome screen */
.itzi-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 24px;
  overflow-y: auto;
  text-align: center;
}
.itzi-welcome-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: -.03em;
}
.itzi-welcome-title span { color: var(--c-neon); }
.itzi-welcome-sub { color: rgba(255,255,255,.5); font-size: 1rem; margin: 0; max-width: 480px; line-height: 1.6; }

.itzi-starter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 640px;
  width: 100%;
  margin-top: 8px;
}
.itzi-starter-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.itzi-starter-card:hover { background: rgba(0,229,160,.08); border-color: rgba(0,229,160,.25); }
.itzi-starter-card strong { font-size: 0.85rem; color: #fff; font-weight: 600; }
.itzi-starter-card span  { font-size: 0.78rem; color: rgba(255,255,255,.45); }

/* Page messages */
.itzi-page-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}
.itzi-page-messages::-webkit-scrollbar { width: 6px; }
.itzi-page-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }

.itzi-page-msg {
  padding: 20px 32px;
  display: flex;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.itzi-page-msg--user { flex-direction: row-reverse; }
.itzi-page-msg--user .itzi-msg-avatar { display: none; }
.itzi-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-hero-mid);
  border: 1px solid rgba(0,229,160,.3);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.itzi-page-msg-content { flex: 1; min-width: 0; }
.itzi-page-msg--user .itzi-page-msg-content {
  background: rgba(0,229,160,.12);
  border: 1px solid rgba(0,229,160,.2);
  border-radius: 12px 12px 2px 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 75%;
  align-self: flex-end;
  margin-left: auto;
}

/* Markdown rendering */
.itzi-md { color: rgba(255,255,255,.88); font-size: 0.9rem; line-height: 1.7; }
.itzi-md h1,.itzi-md h2,.itzi-md h3,.itzi-md h4 { color: #fff; margin: 1.2em 0 .5em; font-weight: 700; }
.itzi-md h1 { font-size: 1.4rem; }
.itzi-md h2 { font-size: 1.2rem; }
.itzi-md h3 { font-size: 1.05rem; }
.itzi-md p  { margin: 0 0 .9em; }
.itzi-md ul,.itzi-md ol { margin: 0 0 .9em 1.4em; padding: 0; }
.itzi-md li { margin-bottom: .3em; }
.itzi-md strong { color: #fff; font-weight: 600; }
.itzi-md em { font-style: italic; color: rgba(255,255,255,.75); }
.itzi-md blockquote {
  border-left: 3px solid rgba(0,229,160,.4);
  padding: .4em 1em;
  margin: .8em 0;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.03);
  border-radius: 0 6px 6px 0;
}
.itzi-md code {
  background: rgba(0,229,160,.1);
  border: 1px solid rgba(0,229,160,.2);
  border-radius: 4px;
  padding: .1em .4em;
  font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: .85em;
  color: var(--c-neon);
}
.itzi-code-block {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  overflow: hidden;
  margin: .8em 0;
}
.itzi-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-size: 0.75rem;
  color: rgba(255,255,255,.4);
}
.itzi-code-lang { font-weight: 600; color: var(--c-neon); text-transform: uppercase; letter-spacing: .06em; }
.itzi-copy-btn {
  background: none; border: none; color: rgba(255,255,255,.4);
  cursor: pointer; font-size: 0.75rem; padding: 2px 8px;
  border-radius: 4px; transition: color .15s, background .15s;
  display: flex; align-items: center; gap: 4px;
}
.itzi-copy-btn:hover { color: var(--c-neon); background: rgba(0,229,160,.08); }
.itzi-copy-btn.copied { color: #4ade80; }
.itzi-code-block pre {
  margin: 0; padding: 16px;
  overflow-x: auto; font-size: 0.82rem; line-height: 1.6;
  font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
  color: rgba(255,255,255,.85);
}
.itzi-code-block pre::-webkit-scrollbar { height: 4px; }
.itzi-code-block pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.itzi-md table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: 0.85rem; }
.itzi-md th { background: rgba(0,229,160,.1); color: var(--c-neon); padding: 8px 12px; text-align: left; font-weight: 600; border-bottom: 1px solid rgba(0,229,160,.2); }
.itzi-md td { padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,.06); color: rgba(255,255,255,.75); }
.itzi-md tr:last-child td { border-bottom: none; }

/* Page typing indicator */
.itzi-page-typing {
  padding: 16px 32px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  gap: 16px;
  align-items: center;
  color: rgba(255,255,255,.4);
  font-size: 0.82rem;
}
.itzi-page-typing-dots { display: flex; gap: 4px; align-items: center; }
.itzi-page-typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-neon);
  animation: itziDot 1.2s ease-in-out infinite;
}
.itzi-page-typing-dots span:nth-child(2) { animation-delay: .2s; }
.itzi-page-typing-dots span:nth-child(3) { animation-delay: .4s; }

/* Message actions */
.itzi-msg-actions { display: flex; gap: 6px; margin-top: 8px; }
.itzi-msg-action-btn {
  background: none; border: none; color: rgba(255,255,255,.25);
  cursor: pointer; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem;
  transition: color .15s, background .15s; display: flex; align-items: center; gap: 4px;
}
.itzi-msg-action-btn:hover { color: rgba(255,255,255,.6); background: rgba(255,255,255,.06); }

/* Input bar */
.itzi-input-bar {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: var(--c-hero-bg);
  flex-shrink: 0;
}
.itzi-page-form { max-width: 860px; margin: 0 auto; }
.itzi-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 10px 14px;
  transition: border-color .15s;
}
.itzi-input-wrap:focus-within { border-color: rgba(0,229,160,.4); }
.itzi-page-input {
  flex: 1; background: none; border: none; color: #fff;
  font-size: 0.9rem; line-height: 1.5; resize: none; outline: none;
  max-height: 200px; overflow-y: auto; font-family: inherit;
}
.itzi-page-input::placeholder { color: rgba(255,255,255,.3); }
.itzi-page-send {
  background: rgba(0,229,160,.18); border: 1px solid rgba(0,229,160,.3);
  border-radius: 9px; padding: 8px 10px; color: var(--c-neon);
  cursor: pointer; flex-shrink: 0; transition: background .15s, transform .1s;
  display: flex; align-items: center;
}
.itzi-page-send:hover { background: rgba(0,229,160,.28); transform: scale(1.05); }
.itzi-page-send:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.itzi-disclaimer { text-align: center; color: rgba(255,255,255,.2); font-size: 0.72rem; margin: 8px 0 0; }

/* Nav highlight */
.nav-itzi { color: var(--c-neon) !important; }

/* ITZI widget open-in-full button */
.itzi-open-full {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: rgba(255,255,255,.35);
  font-size: 0.75rem; cursor: pointer; padding: 6px 16px;
  width: 100%; border-top: 1px solid rgba(255,255,255,.06);
  transition: color .15s; justify-content: center;
}
.itzi-open-full:hover { color: var(--c-neon); }

@media (max-width: 768px) {
  .itzi-page { grid-template-columns: 1fr; }
  .itzi-sidebar { display: none; }
  .itzi-starter-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Onboarding ─────────────────────────────────────────────────────────── */
.onboarding-layout { max-width: 680px; margin: 0 auto; padding: 48px var(--content-pad); }
.onboarding-hero {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 36px;
}
.onboarding-avatar {
  width: 64px; height: 64px; flex-shrink: 0;
  background: rgba(0,229,160,.08); border: 1.5px solid rgba(0,229,160,.25);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.onboarding-title {
  font-size: 1.5rem; font-weight: 800; margin: 0 0 6px; color: var(--c-ink);
  letter-spacing: -.03em;
}
.onboarding-title span { color: var(--c-green); }
.onboarding-sub { color: var(--c-muted); margin: 0; font-size: 0.95rem; }

.onboarding-topics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 28px;
}
.onboarding-topic {
  background: var(--c-surface-mid); border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg); padding: 16px 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  cursor: pointer; transition: border-color .15s, background .15s, transform .12s;
  text-align: left;
}
.onboarding-topic:hover { border-color: var(--c-green); background: var(--c-green-hover); transform: translateY(-2px); }
.onboarding-topic.is-selected { border-color: var(--c-green); background: var(--c-green-subtle); }
.ob-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 4px; }
.onboarding-topic strong { font-size: 0.9rem; color: var(--c-ink); font-weight: 700; }
.onboarding-topic span { font-size: 0.75rem; color: var(--c-muted); }

.onboarding-or { text-align: center; color: var(--c-muted); font-size: 0.82rem; margin: 0 0 12px; }
.onboarding-form { display: flex; gap: 8px; }
.onboarding-form input {
  flex: 1; padding: 10px 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--c-border); background: var(--c-white);
  font-size: 0.9rem; color: var(--c-ink);
  transition: border-color .15s;
}
.onboarding-form input:focus { outline: none; border-color: var(--c-green); }

.onboarding-status {
  display: flex; align-items: center; gap: 12px; margin-top: 20px;
  color: var(--c-muted); font-size: 0.88rem;
}
.onboarding-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--c-border); border-top-color: var(--c-green);
  animation: spin .7s linear infinite; flex-shrink: 0;
}
.onboarding-skip {
  display: block; width: 100%; margin-top: 24px; padding: 10px;
  background: none; border: none; color: var(--c-muted-light);
  font-size: 0.82rem; cursor: pointer; text-align: center;
  transition: color .15s;
}
.onboarding-skip:hover { color: var(--c-ink); }

@media (max-width: 540px) {
  .onboarding-topics { grid-template-columns: repeat(2, 1fr); }
  .onboarding-hero { flex-direction: column; text-align: center; }
}

/* ─── Lernplan-Fortschritt ───────────────────────────────────────────────── */
.plan-progress-bar-wrap {
  background: var(--c-border); border-radius: 99px;
  height: 8px; overflow: hidden; margin: 14px 0 20px;
}
.plan-progress-bar {
  height: 100%; background: var(--c-green); border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
  min-width: 4px;
}
.plan-progress-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; color: var(--c-muted); margin-bottom: 4px;
}
.plan-progress-label strong { color: var(--c-green); font-size: 0.9rem; }

.plan-step {
  background: var(--c-surface-mid); border: 1.5px solid var(--c-border);
  border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px;
  transition: border-color .15s, opacity .2s;
  display: flex; gap: 12px; align-items: flex-start;
}
.plan-step.is-done { opacity: .6; border-color: var(--c-green); background: var(--c-green-subtle); }
.plan-step.is-done .plan-step-title { text-decoration: line-through; color: var(--c-muted); }
.plan-step-check {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px;
  border-radius: 50%; border: 2px solid var(--c-border);
  background: var(--c-white); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .15s;
}
.plan-step.is-done .plan-step-check { background: var(--c-green); border-color: var(--c-green); }
.plan-step.is-done .plan-step-check::after { content: "✓"; color: #fff; font-size: 11px; font-weight: 700; }
.plan-step-body { flex: 1; min-width: 0; }
.plan-step-title { font-weight: 700; font-size: 0.9rem; color: var(--c-ink); margin: 0 0 4px; }
.plan-step-detail { font-size: 0.8rem; color: var(--c-muted); margin: 0; line-height: 1.5; }
.plan-completed-banner {
  background: var(--c-green-subtle); border: 1.5px solid var(--c-green);
  border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  color: var(--c-green); font-weight: 700; font-size: 0.9rem;
}

/* ─── ITZI Mikrofon ──────────────────────────────────────────────────────── */
.itzi-mic-btn {
  background: none; border: none; color: rgba(255,255,255,.35);
  cursor: pointer; padding: 6px; border-radius: 8px; flex-shrink: 0;
  transition: color .15s, background .15s; display: flex; align-items: center;
}
.itzi-mic-btn:hover { color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); }
.itzi-mic-btn.is-recording { color: #ef4444; background: rgba(239,68,68,.1); animation: micPulse 1s ease-in-out infinite; }
.mic-icon-active { display: none; }
.itzi-mic-btn.is-recording .mic-icon-idle  { display: none; }
.itzi-mic-btn.is-recording .mic-icon-active { display: block; }
@keyframes micPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.3); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,.0); } }

/* ─── ITZI file attachments ──────────────────────────────────────────────── */
.itzi-attach-btn {
  background: none; border: none; color: rgba(255,255,255,.35);
  cursor: pointer; padding: 6px; border-radius: 8px; flex-shrink: 0;
  transition: color .15s, background .15s; display: flex; align-items: center;
}
.itzi-attach-btn:hover { color: var(--c-neon); background: rgba(0,229,160,.1); }
.itzi-attach-row {
  display: flex; flex-wrap: wrap; gap: 8px; max-width: 860px; margin: 0 auto 10px;
}
.itzi-attach-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 6px 8px 6px 6px; max-width: 240px;
}
.itzi-attach-thumb { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.itzi-attach-ico { font-size: 1.1rem; width: 28px; text-align: center; flex-shrink: 0; }
.itzi-attach-name {
  font-size: .8rem; color: #fff; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 120px;
}
.itzi-attach-size { font-size: .72rem; color: rgba(255,255,255,.4); flex-shrink: 0; }
.itzi-attach-remove {
  background: none; border: none; color: rgba(255,255,255,.45); cursor: pointer;
  font-size: 1.05rem; line-height: 1; padding: 0 2px; flex-shrink: 0; border-radius: 4px;
}
.itzi-attach-remove:hover { color: #ef4444; background: rgba(239,68,68,.12); }
/* Drag & drop */
.itzi-input-bar { position: relative; }
.itzi-input-bar.is-dragover .itzi-input-wrap { border-color: var(--c-neon); background: rgba(0,229,160,.08); }
.itzi-drop-hint {
  display: none; position: absolute; inset: 8px; border: 2px dashed rgba(0,229,160,.5);
  border-radius: 14px; align-items: center; justify-content: center; color: var(--c-neon);
  font-size: .9rem; font-weight: 600; background: rgba(11,31,23,.85); pointer-events: none; z-index: 5;
}
.itzi-input-bar.is-dragover .itzi-drop-hint { display: flex; }
/* Attachments shown inside chat bubbles */
.itzi-msg-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.itzi-msg-attach-img {
  max-width: 220px; max-height: 220px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); display: block;
}
.itzi-msg-attach-file {
  display: inline-flex; align-items: center; gap: 6px; font-size: .82rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 6px 10px; color: #fff;
}
/* Code block: copy + download actions */
.itzi-code-actions { display: flex; gap: 6px; }
.itzi-download-btn { /* inherits .itzi-copy-btn look */ }
/* ITZI Werkstatt — live app preview */
.itzi-app {
  margin: .8em 0; border: 1px solid rgba(0,229,160,.3); border-radius: 12px;
  overflow: hidden; background: #0d1117;
}
.itzi-app-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: rgba(0,229,160,.08); border-bottom: 1px solid rgba(0,229,160,.2);
}
.itzi-app-title { font-size: .8rem; font-weight: 700; color: var(--c-neon); }
.itzi-app-actions { display: flex; gap: 6px; }
.itzi-app-btn {
  background: rgba(0,229,160,.15); border: 1px solid rgba(0,229,160,.3); color: var(--c-neon);
  font-size: .75rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: background .15s;
}
.itzi-app-btn:hover { background: rgba(0,229,160,.28); }
.itzi-app-frame {
  width: 100%; height: 420px; border: none; background: #fff; display: block;
}
.itzi-app-code { background: rgba(255,255,255,.03); border-top: 1px solid rgba(255,255,255,.07); }
.itzi-app-code summary {
  cursor: pointer; padding: 8px 12px; font-size: .78rem; color: rgba(255,255,255,.5); user-select: none;
}
.itzi-app-code summary:hover { color: var(--c-neon); }
.itzi-app-code pre { margin: 0; padding: 12px; max-height: 320px; overflow: auto; font-size: .78rem; }

/* Toast notifications */
.itzi-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1a2b24; color: #fff; border: 1px solid rgba(0,229,160,.3);
  padding: 12px 18px; border-radius: 10px; font-size: .85rem; z-index: 9999;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 28px rgba(0,0,0,.4); max-width: 90vw;
}
.itzi-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Knowledge Graph ────────────────────────────────────────────────────── */
.graph-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: calc(100vh - var(--nav-h, 64px));
  overflow: hidden;
}
.graph-sidebar {
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.graph-sidebar-head {
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--c-border);
}
.graph-sidebar-head h2 { font-size: 1rem; font-weight: 700; margin: 0 0 .25rem; }
.graph-sidebar-head p  { font-size: .75rem; color: var(--c-muted); margin: 0; }
.graph-legend {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.graph-legend-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--c-muted);
}
.graph-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.graph-stats {
  padding: .75rem 1.25rem;
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--c-border);
}
.graph-stat { text-align: center; }
.graph-stat-num { font-size: 1.1rem; font-weight: 700; color: var(--c-accent); }
.graph-stat-lbl { font-size: .65rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; }
.graph-filter {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
}
.graph-filter input {
  width: 100%;
  padding: .4rem .75rem;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-white);
  color: var(--c-ink);
  font-size: .8rem;
  box-sizing: border-box;
}
.graph-filter input:focus { outline: none; border-color: var(--c-accent); }
.graph-node-list {
  flex: 1;
  overflow-y: auto;
  padding: .5rem 0;
}
.graph-node-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem 1.25rem;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s;
}
.graph-node-item:hover { background: var(--c-border); }
.graph-node-item.is-highlighted { background: rgba(0,229,160,.1); }
.graph-node-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.graph-node-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-canvas-wrap {
  position: relative;
  background: var(--c-surface);
  overflow: hidden;
}
#graphCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#graphCanvas:active { cursor: grabbing; }
.graph-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.graph-ctrl-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-ink);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.graph-ctrl-btn:hover { background: var(--c-accent); color: #000; border-color: var(--c-accent); }
.graph-tooltip {
  position: absolute;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .78rem;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  max-width: 200px;
  z-index: 10;
  display: none;
}
.graph-tooltip strong { display: block; margin-bottom: .2rem; font-size: .82rem; }
.graph-tooltip span { color: var(--c-muted); font-size: .72rem; }
@media (max-width: 768px) {
  .graph-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .graph-sidebar { max-height: 200px; }
}

/* ─── Misc / Utilities ───────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ─── Accessibility ──────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-green-mid);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-green-mid);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── Admin Assistant ────────────────────────────────────────────────────── */
.admin-assistant-settings { margin-top: 20px; }

/* ─── Legacy / Compat helpers ────────────────────────────────────────────── */
/* two-cols → form-row-2 alias */
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .two-cols { grid-template-columns: 1fr; } }

/* Quick access grid on homepage */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

/* Generator console grid */
/* ── Generator Console (legacy, kept for compat) ── */
.generator-console {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ── Generator UI Redesign ── */

/* Status Banner */
.gen-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-muted);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-top: 20px;
  flex-wrap: wrap;
  transition: border-color 0.3s;
}
.gen-banner[data-state="running"] { border-left-color: var(--c-primary); }
.gen-banner[data-state="stopping"] { border-left-color: var(--c-warning, #f59e0b); }
.gen-banner[data-state="error"] { border-left-color: var(--c-danger); }

.gen-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.gen-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}
.gen-banner[data-state="running"] .gen-status-dot {
  background: var(--c-primary);
  animation: gen-pulse 1.4s ease-in-out infinite;
}
.gen-banner[data-state="stopping"] .gen-status-dot { background: var(--c-warning, #f59e0b); }
.gen-banner[data-state="error"] .gen-status-dot { background: var(--c-danger); }
@keyframes gen-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.gen-banner-sep { color: var(--c-border); font-size: 0.85rem; }
.gen-banner-topic-label { color: var(--c-muted); font-size: 0.82rem; }
.gen-banner-topic { color: var(--c-ink); font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-banner-cat { color: var(--c-muted); font-size: 0.85rem; }
.gen-banner-info { font-size: 0.8rem; color: var(--c-muted); }

/* Progress bar */
.gen-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.gen-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--c-border);
  border-radius: 4px;
  overflow: hidden;
}
.gen-progress-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: 4px;
  transition: width 0.6s ease;
}
/* While an article is actively being generated: an animated bar sweeps across
   to signal live activity (the queue-% would barely move during a run). */
.gen-progress-bar.is-generating {
  position: relative;
}
.gen-progress-bar.is-generating .gen-progress-fill {
  width: 40% !important;
  transition: none;
  background: linear-gradient(90deg, transparent, var(--c-primary) 40%, var(--c-primary) 60%, transparent);
  animation: genSweep 1.15s ease-in-out infinite;
}
@keyframes genSweep {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}
@media (prefers-reduced-motion: reduce) {
  .gen-progress-bar.is-generating .gen-progress-fill { animation-duration: 2.4s; }
}
.gen-progress-pct {
  font-size: 0.8rem;
  color: var(--c-muted);
  min-width: 36px;
  text-align: right;
}

/* Stats row */
.gen-stats {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.gen-stat {
  flex: 1;
  min-width: 90px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  text-align: center;
}
.gen-stat-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1;
}
.gen-stat-lbl {
  font-size: 0.75rem;
  color: var(--c-muted);
  margin-top: 4px;
}
.gen-stat--danger .gen-stat-val { color: var(--c-danger); }

/* Controls */
.gen-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.gen-action-status {
  font-size: 0.82rem;
  color: var(--c-muted);
  margin-top: 8px;
  min-height: 18px;
}

/* Main layout: Log + Side */
.gen-main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-top: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .gen-main { grid-template-columns: 1fr; }
}

/* Log panel */
.gen-log-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.gen-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  gap: 12px;
  flex-wrap: wrap;
}
.gen-panel-header h3 { margin: 0; font-size: 0.9rem; }

/* Log tabs */
.gen-log-tabs { display: flex; gap: 4px; }
.gen-tab {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  border: 1px solid var(--c-border);
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.gen-tab:hover { background: var(--c-border); color: var(--c-ink); }
.gen-tab.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* Log scroll area */
.gen-log {
  height: 420px;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 0.82rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gen-log-line {
  display: flex;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  align-items: flex-start;
}
.gen-log-line[data-level="error"] { background: rgba(239,68,68,0.08); color: var(--c-danger); }
.gen-log-line[data-level="warning"] { background: rgba(245,158,11,0.08); color: #92400e; }
.gen-log-line[data-level="success"] { background: rgba(16,185,129,0.08); color: var(--c-success); }
.gen-log-line[data-level="info"] { color: var(--c-muted); }
.gen-log-time { color: var(--c-muted); font-size: 0.75rem; flex-shrink: 0; margin-top: 1px; }
.gen-log-msg { flex: 1; word-break: break-word; }
.gen-log-topic { font-size: 0.75rem; color: var(--c-muted); margin-top: 1px; }
[data-log-level-hidden] { display: none !important; }

/* Side panel */
.gen-side { display: flex; flex-direction: column; gap: 12px; }
.gen-side-block {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.gen-side-block h3 { margin: 0 0 10px; font-size: 0.88rem; }

/* Recent entries */
.gen-recent { margin-top: 20px; }
.gen-recent h3 { margin: 0 0 12px; font-size: 0.95rem; }

/* Empty state */
.gen-empty { color: var(--c-muted); font-size: 0.82rem; margin: 0; }

/* Generator Mode Bar */
.gen-mode-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.gen-mode-label { font-size: 0.82rem; color: var(--c-muted); font-weight: 600; }
.gen-mode-tabs { display: flex; gap: 4px; }
.gen-mode-tab {
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  border: 1px solid var(--c-border);
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.gen-mode-tab:hover { background: var(--c-surface-mid); color: var(--c-ink); }
.gen-mode-tab.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.gen-mode-desc { font-size: 0.78rem; color: var(--c-muted); flex: 1; }

/* Quality Stats Bar */
.gen-quality-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.gen-qstat {
  flex: 1;
  min-width: 80px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  text-align: center;
}
.gen-qstat-val { display: block; font-size: 1.4rem; font-weight: 700; color: var(--c-ink); }
.gen-qstat-lbl { display: block; font-size: 0.72rem; color: var(--c-muted); margin-top: 2px; }
.gen-qstat--excellent .gen-qstat-val { color: var(--c-success); }
.gen-qstat--good .gen-qstat-val { color: var(--c-primary); }
.gen-qstat--warn .gen-qstat-val { color: #d97706; }
.gen-qstat--danger .gen-qstat-val { color: var(--c-danger); }

/* Quality Audit */
.gen-audit {
  margin-top: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.gen-audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
  gap: 10px;
}
.gen-audit-header h3 { margin: 0; font-size: 0.95rem; }
.gen-audit-actions { display: flex; gap: 8px; }
#genAuditEmpty { padding: 16px 18px; }
#genAuditResults { padding: 0 18px 16px; }

.audit-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 12px;
}
.audit-stat { text-align: center; }
.audit-stat strong { display: block; font-size: 1.3rem; }
.audit-stat span { font-size: 0.75rem; color: var(--c-muted); }

.audit-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.83rem;
}
.audit-entry:last-child { border-bottom: 0; }
.audit-score {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 38px;
  text-align: center;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  background: var(--c-surface-mid);
}
.audit-score.critical { background: rgba(239,68,68,0.12); color: var(--c-danger); }
.audit-score.high { background: rgba(245,158,11,0.12); color: #b45309; }
.audit-score.medium { background: rgba(99,102,241,0.1); color: var(--c-primary); }
.audit-score.low { background: rgba(16,185,129,0.1); color: var(--c-success); }
.audit-info { flex: 1; min-width: 0; }
.audit-title { font-weight: 600; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-cat { font-size: 0.75rem; color: var(--c-muted); }
.audit-problems { margin-top: 4px; color: var(--c-danger); font-size: 0.78rem; }
.audit-entry-btn { flex-shrink: 0; }

/* Search / form status messages */
.search-status {
  font-size: 0.83rem;
  color: var(--c-muted);
  margin-top: 8px;
  min-height: 18px;
  line-height: 1.5;
}
.search-status.error { color: var(--c-danger); }
.search-status.success { color: var(--c-success); }

/* Log box (scrollable log output) */
.log-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 0.83rem;
  line-height: 1.7;
  max-height: 280px;
  overflow-y: auto;
  color: var(--c-muted);
}

/* Inline form (horizontal search-like form) */
.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
}
.inline-form input { flex: 1; min-width: 0; }

/* Source form / admin forms */
.source-form { display: grid; gap: 12px; }
.source-list { display: grid; gap: 10px; margin-top: 14px; }

/* Ticket toolbar */
.ticket-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* Article list compact variant */
.article-list.compact { gap: 8px; }
.article-list.compact .knowledge-card,
.article-list.compact .article-card { padding: 14px 16px; }

/* Queue list */
.queue-list { display: grid; gap: 6px; }

/* Compact card */
.compact-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 0.875rem;
}

/* Subscription card highlight */
.subscription-card .badge-gold { font-size: 1rem; padding: 5px 14px; }

/* Generator inline status button group */
.generator-console .admin-card.wide {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.generator-console .admin-card.wide button { align-self: flex-start; }

/* health check / quality grid */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: 0.83rem;
}
.check-item.ok { border-left: 3px solid var(--c-success); }
.check-item.warn { border-left: 3px solid var(--c-warn); }
.check-item.fail { border-left: 3px solid var(--c-danger); }

/* Route status pill grid */
.route-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.route-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-ink-soft);
}

/* Course filter form inline */
.course-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.course-filter input { flex: 1; min-width: 180px; }

/* Advisor box sidebar */
.advisor { gap: 24px; }

/* Contribution form area */
.contribution-form-area {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .contribution-form-area { grid-template-columns: 1fr; } }

/* Generic two-column split (legacy alias) */
.split-section > * { min-width: 0; }

/* Research session form */
#researchSessionForm { display: flex; gap: 10px; }
#researchSessionForm input { flex: 1; min-width: 0; }

/* Me page grid wider cards */
.admin-grid .admin-card.wide { grid-column: 1 / -1; }

/* Ticket inner list */
.ticket-list .ticket-card h3 { font-size: 0.9rem; }

/* Pricing note center */
.pricing-note { text-align: center; color: var(--c-muted-light); font-size: 0.83rem; margin-top: 24px; }

/* Lesson detail */
.lesson-content { max-width: 72ch; font-size: 0.95rem; line-height: 1.75; }
.lesson-content h2, .lesson-content h3 { margin-top: 28px; }
.lesson-content p { margin-bottom: 16px; }

/* Admin Logs toolbar */
.admin-sub-toolbar input { max-width: 260px; }

/* Footer */
footer { border-top: 1px solid var(--c-border); background: var(--c-white); padding: 20px var(--content-pad); text-align: center; color: var(--c-muted-light); font-size: 0.8rem; display: flex; align-items: center; justify-content: center; gap: 12px; }
footer img { height: 24px; opacity: 0.5; }
footer p { margin: 0; }

/* ─── Tag Row / Tag Pill (Knowledge Cards) ───────────────────────────────── */
.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--c-surface-mid);
  color: var(--c-muted);
  border: 1px solid var(--c-border);
  white-space: nowrap;
  cursor: default;
  transition: background var(--t-fast), color var(--t-fast);
}

button.tag {
  cursor: pointer;
}
button.tag:hover {
  background: var(--c-green-hover);
  color: var(--c-green);
  border-color: rgba(22,101,52,.2);
}

.tag.gold { background: var(--c-gold-light); color: var(--c-gold); border-color: rgba(180,83,9,.2); }
.tag.green { background: var(--c-green-light); color: var(--c-green); border-color: rgba(22,101,52,.2); }

/* Queue items */
.queue-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.875rem;
}
.queue-item:last-child { border-bottom: 0; }
.queue-item strong { color: var(--c-ink); }
.queue-item small { color: var(--c-muted); font-size: 0.78rem; }
.queue-item p { margin: 0; font-size: 0.8rem; color: var(--c-danger); }

.queue-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  width: fit-content;
}
.queue-status.pending { background: var(--c-warn-bg); color: var(--c-warn); }
.queue-status.processing { background: var(--c-green-light); color: var(--c-green); }
.queue-status.done { background: var(--c-success-bg); color: var(--c-success); }
.queue-status.failed { background: var(--c-danger-bg); color: var(--c-danger); }
.queue-status.skipped { background: var(--c-surface-mid); color: var(--c-muted); }

/* Log lines */
.log-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.8rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--c-border-soft);
}
.log-line:last-child { border-bottom: 0; }
.log-line b { font-size: 0.72rem; font-weight: 700; min-width: 48px; }
.log-line.success { color: var(--c-success); }
.log-line.warning, .log-line.warn { color: var(--c-warn); }
.log-line.error { color: var(--c-danger); }
.log-line.info { color: var(--c-muted); }
.log-line.skip { color: var(--c-muted-light); }
.log-line span { color: var(--c-muted-light); font-size: 0.72rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   DARK HERO — Network Knowledge Effect
   ═══════════════════════════════════════════════════════════════════════════ */

.hero-dark {
  position: relative;
  background: var(--c-hero-bg);
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
}

/* Animated dot-grid background */
.hero-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(0,229,160,.18) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 40%, transparent 100%);
  animation: gridPulse 8s ease-in-out infinite;
  pointer-events: none;
}

/* Radial glow blob top-right */
.hero-dark::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0,229,160,.09) 0%, rgba(5,150,105,.05) 40%, transparent 70%);
  pointer-events: none;
  animation: blobFloat 12s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.65; }
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 30px) scale(1.08); }
  66% { transform: translate(20px, -20px) scale(0.95); }
}

/* Floating node elements */
.hero-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-node {
  position: absolute;
  border-radius: 50%;
  background: var(--c-neon);
  box-shadow: 0 0 20px 4px var(--c-neon-glow);
  animation: nodeFloat linear infinite;
}

.hero-node:nth-child(1) { width:6px; height:6px; top:18%; left:12%; opacity:.7; animation-duration:14s; animation-delay:0s; }
.hero-node:nth-child(2) { width:4px; height:4px; top:62%; left:8%;  opacity:.5; animation-duration:18s; animation-delay:-4s; }
.hero-node:nth-child(3) { width:8px; height:8px; top:35%; left:80%; opacity:.6; animation-duration:11s; animation-delay:-2s; }
.hero-node:nth-child(4) { width:5px; height:5px; top:75%; left:70%; opacity:.4; animation-duration:16s; animation-delay:-7s; }
.hero-node:nth-child(5) { width:3px; height:3px; top:20%; left:55%; opacity:.6; animation-duration:13s; animation-delay:-3s; }
.hero-node:nth-child(6) { width:6px; height:6px; top:85%; left:30%; opacity:.35; animation-duration:20s; animation-delay:-9s; }
.hero-node:nth-child(7) { width:4px; height:4px; top:50%; left:45%; opacity:.5; animation-duration:15s; animation-delay:-5s; }

@keyframes nodeFloat {
  0%   { transform: translateY(0)   translateX(0); }
  25%  { transform: translateY(-22px) translateX(12px); }
  50%  { transform: translateY(-8px) translateX(28px); }
  75%  { transform: translateY(16px) translateX(8px); }
  100% { transform: translateY(0)   translateX(0); }
}

/* Connection lines SVG overlay */
.hero-connections {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
}

/* Content wrapper */
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 480px);
  gap: 60px;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 100px) var(--content-pad);
}

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .hero-terminal { display: none; }
}

/* Badge pill above headline */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--c-neon-dim);
  border-radius: 100px;
  background: rgba(0,229,160,.07);
  color: var(--c-neon);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-neon);
  box-shadow: 0 0 8px var(--c-neon);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--c-neon); }
  50% { opacity: 0.6; box-shadow: 0 0 14px var(--c-neon); }
}

/* Gradient headline */
.hero-headline {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: #fff;
}

.headline-gradient {
  background: linear-gradient(135deg, var(--c-neon) 0%, #818cf8 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero subtitle */
.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.6);
  line-height: 1.75;
  max-width: 54ch;
  margin: 0 0 32px;
}

/* CTA button row */
.hero-ctas {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Neon primary button */
.btn-neon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--c-neon);
  color: #040d21;
  border: 1px solid var(--c-neon);
  border-radius: var(--r-md);
  font-size: 0.925rem;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow var(--t-base), transform var(--t-base), background var(--t-base);
  text-decoration: none;
  white-space: nowrap;
}
.btn-neon:hover {
  box-shadow: 0 0 24px var(--c-neon-glow), 0 4px 20px rgba(0,229,160,.3);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Ghost button on dark bg */
.btn-dark-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--c-hero-surface);
  color: rgba(255,255,255,.8);
  border: 1px solid var(--c-hero-border);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-base), border-color var(--t-base);
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.btn-dark-ghost:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
  text-decoration: none;
}

/* Hero search form */
.hero-search-dark {
  display: flex;
  gap: 0;
  margin-top: 32px;
  max-width: 520px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.hero-search-dark:focus-within {
  border-color: var(--c-neon-dim);
  box-shadow: 0 0 0 3px rgba(0,229,160,.1);
}
.hero-search-dark input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  padding: 14px 18px;
  font-size: 0.9rem;
  box-shadow: none;
}
.hero-search-dark input::placeholder { color: rgba(255,255,255,.35); }
.hero-search-dark input:focus { box-shadow: none; }
.hero-search-dark button {
  padding: 14px 22px;
  background: var(--c-neon);
  color: #040d21;
  border: 0;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.hero-search-dark button:hover { background: #00c890; }

/* Terminal / stats panel */
.hero-terminal {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--r-xl);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}
.terminal-dot { width:10px; height:10px; border-radius:50%; }
.terminal-dot.red   { background: #ef4444; }
.terminal-dot.yellow{ background: #eab308; }
.terminal-dot.green { background: var(--c-neon); box-shadow: 0 0 6px var(--c-neon); }
.terminal-label {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: rgba(255,255,255,.35);
}

.terminal-body {
  padding: 20px 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.9;
  color: rgba(255,255,255,.7);
}
.terminal-line { display: flex; gap: 10px; }
.terminal-prompt { color: var(--c-neon); user-select: none; }
.terminal-cmd { color: rgba(255,255,255,.9); }
.terminal-out { color: rgba(255,255,255,.45); padding-left: 18px; }
.terminal-out .val { color: var(--c-neon); font-weight: 500; }
.terminal-out .amber { color: var(--c-gold-mid); font-weight: 500; }
.terminal-out .purple { color: #818cf8; font-weight: 500; }
.terminal-out .red { color: #f87171; font-weight: 500; }

.terminal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255,255,255,.06);
  border-top: 1px solid rgba(255,255,255,.06);
}
.terminal-stat {
  background: rgba(4,13,33,.6);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.terminal-stat strong {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  line-height: 1;
}
.terminal-stat span {
  font-size: 0.72rem;
  color: rgba(255,255,255,.4);
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.terminal-generator {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: rgba(255,255,255,.4);
}
.terminal-generator .gen-indicator {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--c-gold-mid);
}

/* Hero bottom gradient fade */
.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--c-surface));
  pointer-events: none;
  z-index: 3;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGO — SVG Mark
   ═══════════════════════════════════════════════════════════════════════════ */

.logo-mark {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  flex-shrink: 0;
}
.logo-svg { width: 38px; height: 38px; flex-shrink: 0; }
.logo-text {
  display: none;
  flex-direction: column;
  gap: 0;
}
@media (min-width: 900px) { .logo-text { display: flex; } }
.logo-name {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo-sub {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--c-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION — Redesigned clean header
   ═══════════════════════════════════════════════════════════════════════════ */

.site-header {
  gap: 8px;
}

/* Nav gets some spacing */
.top-nav { padding: 0 4px; }

/* Direct nav buttons more spacious */
.top-nav > button,
.nav-trigger {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--r-md);
}

/* Auth panel right side — minimal */
.auth-panel {
  gap: 6px;
}

/* Session info label */
.session-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}
.session-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-green) 0%, #818cf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.session-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-ink);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Login button — outlined */
.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-white);
  color: var(--c-ink);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.btn-login:hover {
  border-color: var(--c-green-mid);
  box-shadow: 0 2px 8px rgba(5,150,105,.12);
  background: var(--c-green-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FEATURES BAND — Redesigned
   ═══════════════════════════════════════════════════════════════════════════ */

.feature-band-v2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--c-white);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

.feature-band-v2 .fb-item {
  padding: 32px 28px;
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background var(--t-base);
  cursor: default;
}
.feature-band-v2 .fb-item:last-child { border-right: 0; }
.feature-band-v2 .fb-item:hover { background: var(--c-surface); }

.fb-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fb-icon.green { background: var(--c-green-light); color: var(--c-green); }
.fb-icon.amber { background: var(--c-gold-light); color: var(--c-gold); }
.fb-icon.purple { background: #ede9fe; color: #7c3aed; }
.fb-icon.blue   { background: #dbeafe; color: #2563eb; }
.fb-icon svg { width: 20px; height: 20px; }

.fb-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-green);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fb-title { font-size: 1.05rem; font-weight: 700; color: var(--c-ink); margin: 0; }
.fb-desc  { font-size: 0.83rem; color: var(--c-muted); line-height: 1.6; margin: 0; }

@media (max-width: 900px) {
  .feature-band-v2 { grid-template-columns: repeat(2, 1fr); }
  .feature-band-v2 .fb-item { border-bottom: 1px solid var(--c-border); }
}
@media (max-width: 480px) {
  .feature-band-v2 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CATEGORY CARDS — Redesigned
   ═══════════════════════════════════════════════════════════════════════════ */

.category-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
  text-align: left;
  width: 100%;
}
.category-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: rgba(5,150,105,.2);
  transform: translateY(-2px);
}
.category-card strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.3;
}
.category-card .count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--c-green);
  line-height: 1;
}
.category-card small {
  font-size: 0.75rem;
  color: var(--c-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   QUICK ACCESS — Redesigned cards
   ═══════════════════════════════════════════════════════════════════════════ */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 720px) { .quick-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .quick-grid { grid-template-columns: 1fr; } }

.auto-page-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
  width: 100%;
  position: relative;
  overflow: hidden;
}
.auto-page-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--c-green);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--t-base);
}
.auto-page-card:hover {
  background: var(--c-green-hover);
  border-color: rgba(5,150,105,.25);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}
.auto-page-card:hover::before { transform: scaleY(1); }
.auto-page-card span { font-size: 0.9rem; font-weight: 700; color: var(--c-ink); }
.auto-page-card small { font-size: 0.78rem; color: var(--c-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION DIVIDER
   ═══════════════════════════════════════════════════════════════════════════ */

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--c-border) 20%, var(--c-border) 80%, transparent 100%);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE — Konto erstellen link
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-toggle-section {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--c-muted);
}
.auth-toggle-section button {
  background: none;
  border: none;
  color: var(--c-green);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0;
}
.auth-toggle-section button:hover { text-decoration: underline; }

/* ─── Keyframes ──────────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.app-page.is-active { animation: fadeIn 0.18s ease both; }

/* Reveal animation for hero elements */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
.hero-inner > * { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-inner > *:nth-child(2) { animation-delay: 0.12s; }

/* ─── ITZI Code: agentic project builder (Admin) ──────────────────────────── */
#page-itzi-code { padding: 0; }
.izc-wrap { display: grid; grid-template-columns: 240px 1fr; height: calc(100vh - 72px); min-height: 560px; }
.izc-sidebar { border-right: 1px solid var(--c-border); padding: 16px; overflow-y: auto; background: var(--c-surface, rgba(255,255,255,.02)); }
.izc-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.izc-sidebar-head h2 { margin: 0; font-size: 1.1rem; }
.izc-hint { font-size: .76rem; color: var(--c-muted); margin: 0 0 14px; line-height: 1.5; }
.izc-project-list { display: flex; flex-direction: column; gap: 6px; }
.izc-project-item { display: flex; align-items: stretch; gap: 4px; border-radius: 8px; overflow: hidden; border: 1px solid transparent; }
.izc-project-item.is-active { border-color: rgba(0,229,160,.4); background: rgba(0,229,160,.07); }
.izc-project-open { flex: 1; text-align: left; background: none; border: none; cursor: pointer; padding: 8px 10px; color: inherit; display: flex; flex-direction: column; gap: 2px; }
.izc-project-open strong { font-size: .82rem; }
.izc-project-open span { font-size: .7rem; color: var(--c-muted); }
.izc-project-open:hover { background: rgba(255,255,255,.04); }
.izc-project-del { background: none; border: none; color: var(--c-muted); cursor: pointer; padding: 0 8px; font-size: 1.1rem; }
.izc-project-del:hover { color: #ef4444; }
.izc-empty { font-size: .78rem; color: var(--c-muted); padding: 8px 2px; }

.izc-main { display: flex; flex-direction: column; min-width: 0; padding: 16px; gap: 12px; }
.izc-prompt-bar { display: flex; gap: 10px; align-items: stretch; }
#izcPrompt { flex: 1; resize: none; border-radius: 10px; border: 1px solid var(--c-border); background: var(--c-surface, rgba(255,255,255,.03)); color: inherit; padding: 10px 12px; font: inherit; font-size: .88rem; }
#izcPrompt:focus { outline: none; border-color: rgba(0,229,160,.5); }
#izcBuild { white-space: nowrap; }
.izc-status { font-size: .82rem; padding: 8px 12px; border-radius: 8px; }
.izc-status--working { background: rgba(0,229,160,.1); color: var(--c-neon, #00e5a0); }
.izc-status--success { background: rgba(74,222,128,.12); color: #4ade80; }
.izc-status--error { background: rgba(239,68,68,.12); color: #ef4444; }
.izc-status--info { background: rgba(255,255,255,.05); color: var(--c-muted); }

.izc-workspace { flex: 1; display: grid; grid-template-columns: 180px 1fr 1fr; gap: 12px; min-height: 0; }
.izc-files, .izc-editor-pane, .izc-preview-pane { border: 1px solid var(--c-border); border-radius: 10px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.izc-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: .76rem; font-weight: 600; color: var(--c-muted); border-bottom: 1px solid var(--c-border); background: rgba(255,255,255,.02); }
.izc-file-tree { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.izc-file { display: flex; align-items: center; gap: 6px; text-align: left; background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: 6px; color: inherit; font-size: .78rem; font-family: "Fira Code", Consolas, monospace; }
.izc-file:hover { background: rgba(255,255,255,.05); }
.izc-file.is-active { background: rgba(0,229,160,.12); color: var(--c-neon, #00e5a0); }
.izc-file-ico { font-size: .9rem; }
.izc-editor { flex: 1; resize: none; border: none; background: #0d1117; color: #e6edf3; padding: 12px; font-family: "Fira Code", "Cascadia Code", Consolas, monospace; font-size: .8rem; line-height: 1.6; outline: none; white-space: pre; overflow: auto; }
.izc-preview-frame { flex: 1; width: 100%; border: none; background: #fff; }
.izc-preview-actions { display: flex; gap: 6px; }

@media (max-width: 1100px) {
  .izc-wrap { grid-template-columns: 1fr; height: auto; }
  .izc-workspace { grid-template-columns: 1fr; }
  .izc-editor { min-height: 240px; }
  .izc-preview-frame { min-height: 360px; }
}

/* ITZI Code — GitHub & Deploy */
.izc-github { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--c-border); }
.izc-gh-status { font-size: .78rem; margin-bottom: 6px; }
.izc-gh-input { width: 100%; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--c-border); background: var(--c-surface, rgba(255,255,255,.03)); color: inherit; font-size: .76rem; }
.izc-gh-input:focus { outline: none; border-color: rgba(0,229,160,.5); }
.izc-gh-help { display: inline-block; margin-top: 6px; font-size: .72rem; color: var(--c-neon, #00e5a0); text-decoration: none; }
.izc-gh-help:hover { text-decoration: underline; }
.izc-deploy-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
.izc-deploy-links { font-size: .78rem; display: flex; gap: 12px; flex-wrap: wrap; }
.izc-deploy-links a { color: var(--c-neon, #00e5a0); text-decoration: none; }
.izc-deploy-links a:hover { text-decoration: underline; }

/* ITZI Code — server run log */
.izc-run-log {
  background: #0d1117; color: #c9d1d9; border: 1px solid var(--c-border); border-radius: 8px;
  padding: 10px 12px; margin: 0; max-height: 180px; overflow: auto;
  font-family: "Fira Code", Consolas, monospace; font-size: .74rem; line-height: 1.5; white-space: pre-wrap;
}

/* ITZI Self-Improve overlay */
.izc-self-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--c-border); }
.izc-self-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.izc-self-overlay[hidden] { display: none; }
.izc-self-modal { background: var(--c-bg, #0b1f17); border: 1px solid var(--c-border); border-radius: 14px; width: min(820px, 96vw); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.izc-self-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--c-border); }
.izc-self-modal-head h3 { margin: 0; font-size: 1.05rem; }
.izc-self-close { background: none; border: none; color: var(--c-muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.izc-self-close:hover { color: #ef4444; }
.izc-self-modal-body { padding: 16px 18px; overflow-y: auto; }
.izc-self-warn { font-size: .8rem; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #f59e0b; border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; line-height: 1.5; }
.izc-self-label { display: block; font-size: .8rem; font-weight: 600; margin: 12px 0 6px; }
.izc-self-files { display: flex; flex-wrap: wrap; gap: 8px; }
.izc-self-file { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-family: "Fira Code", monospace; background: rgba(255,255,255,.04); border: 1px solid var(--c-border); border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.izc-self-file span { color: var(--c-muted); font-size: .72rem; }
.izc-self-file { color: #fff; }
#izcSelfInstruction { width: 100%; border-radius: 9px; border: 1px solid var(--c-border); background: var(--c-surface, rgba(255,255,255,.03)); color: inherit; padding: 9px 11px; font: inherit; font-size: .86rem; resize: vertical; }
.izc-self-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.izc-self-status { font-size: .8rem; color: var(--c-muted); }
.izc-self-summary { font-size: .88rem; margin: 16px 0 10px; padding: 10px 12px; background: rgba(0,229,160,.08); border-radius: 8px; color: #ffffff; }
.izc-self-file-block { border: 1px solid var(--c-border); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.izc-self-file-head { padding: 8px 12px; background: rgba(255,255,255,.03); font-size: .8rem; border-bottom: 1px solid var(--c-border); }
.izc-chk-ok { color: #4ade80; } .izc-chk-fail { color: #ef4444; }
.izc-self-checkerr { background:#2a0d0d; color:#fca5a5; padding:8px 12px; margin:0; font-size:.74rem; white-space:pre-wrap; }
.izc-self-notes { padding: 6px 12px; font-size: .74rem; color: #f59e0b; }
.izc-self-edit { padding: 8px 12px; border-top: 1px dashed var(--c-border); }
.izc-self-edit-reason { font-size: .74rem; color: var(--c-muted); margin-bottom: 4px; }
.izc-diff-old, .izc-diff-new { margin: 0; padding: 6px 8px; font-family: "Fira Code", monospace; font-size: .74rem; white-space: pre-wrap; border-radius: 5px; overflow-x: auto; }
.izc-diff-old { background: rgba(239,68,68,.12); color: #fca5a5; }
.izc-diff-new { background: rgba(74,222,128,.12); color: #86efac; margin-top: 3px; }
.izc-self-apply-bar { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-border); flex-wrap: wrap; }
.izc-self-applied { font-size: .82rem; background: rgba(0,229,160,.08); border-radius: 8px; padding: 10px 12px; margin-top: 10px; line-height: 1.6; color: #ffffff; }
.izc-self-empty { font-size: .85rem; color: var(--c-muted); padding: 10px; }

/* ─── ITZI Code v2 — Emergent-style layout ───────────────────────────────── */
#page-itzi-code { padding: 0; }
.izc2 { display: flex; flex-direction: column; height: calc(100vh - 72px); min-height: 560px; }
.izc2-topbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--c-border); background: var(--c-surface, rgba(255,255,255,.02)); flex-shrink: 0; }
.izc2-brand { font-weight: 800; font-size: .9rem; color: var(--c-neon, #00e5a0); white-space: nowrap; }
.izc2-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; }
.izc2-tab { display: flex; align-items: center; border: 1px solid var(--c-border); border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.03); flex-shrink: 0; }
.izc2-tab.is-active { border-color: rgba(0,229,160,.5); background: rgba(0,229,160,.1); }
.izc2-tab-open { background: none; border: none; color: inherit; cursor: pointer; padding: 6px 10px; font-size: .8rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.izc2-tab-del { background: none; border: none; color: var(--c-muted); cursor: pointer; padding: 0 8px; font-size: 1rem; }
.izc2-tab-del:hover { color: #ef4444; }
.izc2-tab-empty { font-size: .8rem; color: var(--c-muted); }
.izc2-newtab { background: rgba(0,229,160,.15); border: 1px solid rgba(0,229,160,.3); color: var(--c-neon); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 1.1rem; flex-shrink: 0; }
.izc2-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.izc2-credits { font-size: .78rem; color: var(--c-neon, #00e5a0); background: rgba(0,229,160,.1); padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.izc2-gh-wrap { position: relative; }
.izc2-gh-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; background: var(--c-bg, #0b1f17); border: 1px solid var(--c-border); border-radius: 10px; padding: 12px; z-index: 50; box-shadow: 0 12px 32px rgba(0,0,0,.4); }

.izc2-body { flex: 1; display: grid; grid-template-columns: minmax(320px, 38%) 1fr; min-height: 0; }
.izc2-chat { display: flex; flex-direction: column; border-right: 1px solid var(--c-border); min-height: 0; min-width: 0; }
.izc2-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.izc2-welcome { margin: auto; text-align: center; max-width: 300px; color: var(--c-muted); }
.izc2-welcome-icon { font-size: 2.4rem; }
.izc2-welcome strong { display: block; color: var(--c-neon, #00e5a0); margin: 8px 0 4px; font-size: 1.05rem; }
.izc2-welcome p { font-size: .84rem; line-height: 1.5; }
.izc2-msg { display: flex; gap: 8px; max-width: 100%; }
.izc2-msg--user { justify-content: flex-end; }
.izc2-msg--user .izc2-bubble { background: rgba(0,229,160,.14); border: 1px solid rgba(0,229,160,.25); max-width: 85%; }
.izc2-msg--bot .izc2-bubble { background: rgba(255,255,255,.04); border: 1px solid var(--c-border); max-width: 90%; }
.izc2-bubble { padding: 9px 12px; border-radius: 12px; font-size: .85rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.izc2-avatar { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; background: rgba(0,229,160,.15); color: var(--c-neon); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .78rem; }
.izc2-attach-note { font-size: .72rem; color: var(--c-muted); margin-top: 4px; }
.izc2-filechips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.izc2-filechip { font-size: .72rem; background: rgba(255,255,255,.06); border: 1px solid var(--c-border); border-radius: 6px; padding: 2px 7px; font-family: "Fira Code", monospace; }
.izc2-thinking { color: var(--c-muted); }
.izc2-dots span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--c-neon, #00e5a0); margin: 0 1px; animation: izcDot 1.2s infinite; }
.izc2-dots span:nth-child(2) { animation-delay: .2s; } .izc2-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes izcDot { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }
.izc2-status-wrap { padding: 0 12px; }
.izc2-composer { border-top: 1px solid var(--c-border); padding: 10px 12px; background: var(--c-surface, rgba(255,255,255,.02)); }
.izc2-composer-input { display: flex; align-items: flex-end; gap: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--c-border); border-radius: 12px; padding: 8px 10px; overflow: hidden; }
.izc2-composer-input:focus-within { border-color: rgba(0,229,160,.45); }
#izcPrompt { flex: 1; background: none; border: none; color: inherit; resize: none; outline: none; font: inherit; font-size: .88rem; line-height: 1.5; max-height: 160px; }
.izc2-send { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }

.izc2-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.izc2-right-tabs { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--c-border); }
.izc2-rtab { background: none; border: none; color: var(--c-muted); cursor: pointer; padding: 6px 12px; border-radius: 7px; font-size: .82rem; font-weight: 600; }
.izc2-rtab.is-active { background: rgba(0,229,160,.12); color: var(--c-neon, #00e5a0); }
.izc2-right-actions { margin-left: auto; display: flex; gap: 5px; flex-wrap: wrap; }
.izc2-links { padding: 4px 12px; font-size: .76rem; display: flex; gap: 12px; flex-wrap: wrap; }
.izc2-links a { color: var(--c-neon, #00e5a0); text-decoration: none; }
.izc2-links a:hover { text-decoration: underline; }
.izc2-links:empty { display: none; }
.izc2-pane { flex: 1; min-height: 0; }
#izcPanePreview { display: flex; }
#izcPanePreview .izc-preview-frame { flex: 1; width: 100%; height: 100%; border: none; background: #fff; }
.izc2-code-grid { display: grid; grid-template-columns: 170px 1fr; height: 100%; min-height: 0; }
.izc2-code-grid .izc-file-tree { border-right: 1px solid var(--c-border); overflow-y: auto; padding: 6px; }
.izc2-code-grid .izc-editor-pane { display: flex; flex-direction: column; min-height: 0; }
.izc2-code-grid .izc-editor { flex: 1; }

@media (max-width: 1024px) {
  .izc2 { height: auto; }
  .izc2-body { grid-template-columns: 1fr; }
  .izc2-chat { border-right: none; border-bottom: 1px solid var(--c-border); }
  .izc2-log { min-height: 280px; max-height: 50vh; }
  #izcPanePreview .izc-preview-frame, .izc2-code-grid { min-height: 360px; }
}

/* ITZI Self-Improve: problem-first */
.izc-self-scope { margin: 6px 0 10px; }
.izc-self-scope summary { cursor: pointer; font-size: .78rem; color: var(--c-muted); }
.izc-self-scope summary:hover { color: var(--c-neon, #00e5a0); }
.izc-self-scope .izc-self-files { margin-top: 8px; }
.izc-self-picked { font-size: .8rem; background: rgba(0,229,160,.08); border: 1px solid rgba(0,229,160,.25); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }

/* ITZI: Mermaid diagrams + voice */
.itzi-mermaid-wrap { background: rgba(255,255,255,.03); border: 1px solid var(--c-border, rgba(255,255,255,.1)); border-radius: 10px; padding: 14px; margin: .8em 0; overflow-x: auto; text-align: center; }
.itzi-mermaid svg { max-width: 100%; height: auto; }
.itzi-mermaid-err { color: #fca5a5; font-size: .8rem; margin: 0; }
.itzi-speak-btn.speaking { color: var(--c-neon, #00e5a0); animation: itziSpeakPulse 1s ease-in-out infinite; }
@keyframes itziSpeakPulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ITZI: knowledge-base links (RAG) */
.itzi-entry-link { color: var(--c-neon, #00e5a0); text-decoration: none; border-bottom: 1px dashed rgba(0,229,160,.5); cursor: pointer; }
.itzi-entry-link:hover { border-bottom-style: solid; }
.itzi-md a { color: var(--c-neon, #00e5a0); }

/* ITZI: action buttons */
.itzi-action-btn { display: inline-block; margin: 8px 0; background: rgba(0,229,160,.16); border: 1px solid rgba(0,229,160,.35); color: var(--c-neon, #00e5a0); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: .85rem; font-weight: 600; }
.itzi-action-btn:hover { background: rgba(0,229,160,.28); }
.itzi-action-btn.done { background: rgba(74,222,128,.15); border-color: rgba(74,222,128,.4); color: #4ade80; cursor: default; }

/* ITZI Self-Improve: history */
.izc-self-history-wrap { margin-top: 16px; border-top: 1px solid var(--c-border); padding-top: 10px; }
.izc-self-history-wrap summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--c-muted); }
.izc-self-history-wrap summary:hover { color: var(--c-neon, #00e5a0); }
.izc-self-history { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.izc-hist-item { border: 1px solid var(--c-border); border-radius: 9px; padding: 9px 11px; font-size: .8rem; }
.izc-hist-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.izc-hist-date { color: var(--c-muted); font-size: .72rem; }
.izc-hist-badge { font-size: .68rem; padding: 2px 7px; border-radius: 20px; background: rgba(255,255,255,.08); color: var(--c-muted); }
.izc-hist-badge.applied { background: rgba(74,222,128,.15); color: #4ade80; }
.izc-hist-badge.rb { background: rgba(245,158,11,.15); color: #f59e0b; }
.izc-hist-instr { color: var(--text, #e6edf3); }
.izc-hist-sum { color: var(--c-muted); margin-top: 3px; }
.izc-hist-files { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.izc-hist-files code { font-size: .7rem; background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 5px; }
.izc-hist-item button { margin-top: 7px; }

/* ITZI Code: aktiver Builder (Provider-Badge im Top-Bar) */
.izc-builder-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--c-muted); border: 1px solid rgba(255,255,255,.10); white-space: nowrap; }
.izc-builder-badge.is-frontier { background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(56,142,90,.18)); color: #f0d98c; border-color: rgba(212,175,55,.45); }

/* ITZI Code: Builder-/Modell-Auswahl (Dropdown in der Topbar) */
.izc2-builder-select { background: rgba(255,255,255,.06); color: var(--text, #e6edf3); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 5px 8px; font-size: .76rem; font-weight: 600; max-width: 230px; cursor: pointer; }
.izc2-builder-select:hover { border-color: rgba(212,175,55,.45); }
.izc2-builder-select option { background: #11161d; color: #e6edf3; }

/* ITZI Code: Modus-Umschalter (Bauen / Fragen) */
.izc2-mode { display: inline-flex; gap: 4px; margin-bottom: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10); border-radius: 10px; padding: 3px; }
.izc2-mode-btn { background: transparent; border: 0; color: var(--c-muted); font-size: .78rem; font-weight: 600; padding: 5px 12px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.izc2-mode-btn:hover { color: var(--text, #e6edf3); }
.izc2-mode-btn.is-active { background: rgba(212,175,55,.18); color: #f0d98c; }

/* ITZI Chat: Modellauswahl für Datei-Analyse */
.itzi-chat-builder { background: rgba(255,255,255,.06); color: var(--text, #e6edf3); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 4px 6px; font-size: .72rem; font-weight: 600; max-width: 180px; cursor: pointer; }
.itzi-chat-builder:hover { border-color: rgba(212,175,55,.45); }
.itzi-chat-builder option { background: #11161d; color: #e6edf3; }

/* ── Bild-Tools / Media-Galerie ───────────────────────────────────────────── */
#page-media .section-sub { color: var(--c-muted); margin-top: 4px; }
.media-gate { background: rgba(255,255,255,.04); border: 1px solid var(--c-border); border-radius: 12px; padding: 24px; text-align: center; }
.media-gate .primary { margin-top: 10px; }
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .media-grid { grid-template-columns: 1fr; } }
.media-tools, .media-side { display: flex; flex-direction: column; gap: 16px; }
.media-card { background: rgba(255,255,255,.03); border: 1px solid var(--c-border); border-radius: 12px; padding: 16px; }
.media-card h3 { margin: 0 0 12px; font-size: .98rem; }
.media-card textarea, .media-card input[type=text], .media-card select { width: 100%; box-sizing: border-box; background: rgba(255,255,255,.04); color: var(--text, #e6edf3); border: 1px solid var(--c-border); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: .86rem; }
.media-card textarea { resize: vertical; }
.media-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.media-row select { flex: 1; }
.media-drop { border: 2px dashed var(--c-border); border-radius: 10px; padding: 18px; text-align: center; color: var(--c-muted); transition: border-color .15s, background .15s; margin-bottom: 10px; }
.media-drop.is-over { border-color: var(--c-neon, #00e5a0); background: rgba(0,229,160,.06); }
.link-btn { background: none; border: none; color: var(--c-neon, #00e5a0); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }
.media-preview { max-width: 100%; max-height: 240px; border-radius: 8px; margin-top: 10px; display: block; }
.media-canvas { max-width: 100%; border: 1px solid var(--c-border); border-radius: 8px; margin: 10px 0; background: #0008; }
.media-filters { gap: 6px; }
.btn-sm { font-size: .78rem; padding: 6px 11px; }
.btn-xs { font-size: .7rem; padding: 4px 8px; }
.media-ai-edit { display: flex; gap: 8px; margin-top: 10px; }
.media-ai-edit input { flex: 1; }
.media-field { display: block; margin-top: 12px; }
.media-field > span { display: block; font-size: .74rem; color: var(--c-muted); margin-bottom: 4px; }
.media-copyrow { display: flex; gap: 6px; }
.media-copyrow input { flex: 1; box-sizing: border-box; background: rgba(255,255,255,.04); color: var(--text, #e6edf3); border: 1px solid var(--c-border); border-radius: 8px; padding: 8px 10px; font-family: "Fira Code", monospace; font-size: .76rem; }
.media-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.media-empty { color: var(--c-muted); font-size: .85rem; grid-column: 1 / -1; }
.media-tile { border: 1px solid var(--c-border); border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.03); }
.media-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-tile-actions { display: flex; gap: 4px; padding: 6px; justify-content: center; }
.media-del { color: #ef4444; }
.media-status { margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: .84rem; background: rgba(255,255,255,.05); }
.media-status.is-working { background: rgba(59,130,246,.12); color: #93c5fd; }
.media-status.is-success { background: rgba(0,229,160,.1); color: #6ee7b7; }
.media-status.is-error { background: rgba(239,68,68,.12); color: #fca5a5; }

/* Admin-Tab → Sprung zur Sektion: kurze Hervorhebung */
.admin-section-flash { outline: 2px solid var(--c-neon, #00e5a0); outline-offset: 3px; border-radius: 12px; transition: outline-color .4s; animation: adminFlash 1.6s ease; }
@keyframes adminFlash { 0% { outline-color: var(--c-neon, #00e5a0); } 70% { outline-color: var(--c-neon, #00e5a0); } 100% { outline-color: transparent; } }
