:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --border: #E8E6DF;
  --text: #1C1C1A;
  --muted: #6B6B67;
  --hint: #A8A8A3;
  --accent: #2D6A4F;
  --accent-light: #E8F4EE;
  --accent-dark: #1B4332;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* NAV */
nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 1.5rem; height: 60px; }
.logo { font-family: 'Lora', serif; font-size: 18px; font-weight: 600; color: var(--accent-dark); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.logo-icon { font-size: 20px; }
.nav-search-wrap { flex: 1; max-width: 380px; }
.nav-search-wrap input { width: 100%; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg); font-size: 14px; color: var(--text); outline: none; font-family: 'DM Sans', sans-serif; transition: border-color 0.2s; }
.nav-search-wrap input:focus { border-color: var(--accent); }
.nav-links { display: flex; gap: 1.25rem; margin-left: auto; }
.nav-links a { font-size: 13px; color: var(--muted); transition: color 0.15s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); font-weight: 500; }

/* BREADCRUMB */
.breadcrumb { max-width: 1100px; margin: 0 auto; padding: 0.75rem 1.5rem; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--hint); }

/* HERO */
.hero { background: linear-gradient(135deg, var(--accent-dark) 0%, #2D6A4F 60%, #52B788 100%); color: white; padding: 3.5rem 1.5rem 2.5rem; text-align: center; }
.hero h1 { font-family: 'Lora', serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 600; margin-bottom: 0.6rem; }
.hero p { font-size: 16px; opacity: 0.85; max-width: 500px; margin: 0 auto 1.75rem; }
.hero-search-box { display: flex; max-width: 540px; margin: 0 auto; background: white; border-radius: 99px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.hero-search-box input { flex: 1; padding: 13px 20px; border: none; font-size: 15px; font-family: 'DM Sans', sans-serif; color: var(--text); outline: none; }
.hero-search-box button { padding: 13px 22px; background: var(--accent); color: white; border: none; font-size: 14px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; }
.hero-search-box button:hover { background: var(--accent-dark); }
.stats { display: flex; justify-content: center; gap: 2.5rem; margin-top: 2rem; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { font-size: 26px; font-weight: 600; font-family: 'Lora', serif; }
.stat-label { font-size: 12px; opacity: 0.7; margin-top: 1px; }

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; display: grid; grid-template-columns: 210px 1fr; gap: 2rem; align-items: start; }
.container.full { grid-template-columns: 1fr; }

/* SIDEBAR */
.sidebar { position: sticky; top: 72px; }
.sidebar-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.sidebar-title { padding: 12px 16px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg); }
.sidebar-item { display: flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 13px; color: var(--muted); cursor: pointer; transition: background 0.1s; border-bottom: 1px solid var(--border); }
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover, .sidebar-item.active { background: var(--accent-light); color: var(--accent-dark); font-weight: 500; }
.sidebar-item .cat-icon { font-size: 15px; }

/* CATEGORY GRID on homepage */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 3rem; }
.cat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; align-items: flex-start; gap: 12px; transition: all 0.15s; }
.cat-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.cat-card-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.cat-card-body {}
.cat-card-name { font-size: 15px; font-weight: 500; margin-bottom: 3px; }
.cat-card-count { font-size: 12px; color: var(--hint); margin-bottom: 5px; }
.cat-card-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* TERMS GRID */
.terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 2.5rem; }
.term-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; transition: all 0.15s; display: block; }
.term-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(45,106,79,0.1); }
.term-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.term-hint { font-size: 12px; color: var(--hint); line-height: 1.4; }

/* SECTION HEADER */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--border); }
.section-title { font-family: 'Lora', serif; font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.section-count { font-size: 13px; color: var(--muted); }

/* SINGLE TERM PAGE */
.term-page { max-width: 780px; }
.term-page h1 { font-family: 'Lora', serif; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; margin-bottom: 0.5rem; }
.term-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.term-kurz { font-size: 18px; color: var(--muted); font-style: italic; font-family: 'Lora', serif; margin-bottom: 2rem; line-height: 1.6; }
.term-section { margin-bottom: 2rem; }
.term-section h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 0.75rem; }
.term-section p { font-size: 16px; line-height: 1.8; margin-bottom: 0.75rem; }
.term-section ul { list-style: none; padding: 0; }
.term-section ul li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.term-section ul li:last-child { border-bottom: none; }
.term-section ul li::before { content: "→"; color: var(--accent); font-weight: 600; flex-shrink: 0; }
.related-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-chip { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border); font-size: 13px; color: var(--muted); transition: all 0.15s; }
.rel-chip:hover { background: var(--accent-light); color: var(--accent-dark); border-color: var(--accent); }

/* AZ JUMP */
.az-jump { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.az-jump-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 0.6rem; }
.az-row { display: flex; flex-wrap: wrap; gap: 3px; }
.az-btn { padding: 4px 8px; border-radius: 4px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--muted); transition: all 0.1s; }
.az-btn:hover { background: var(--accent-light); color: var(--accent-dark); }

/* LOADING / AI PLACEHOLDER */
.ai-placeholder { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.dot:nth-child(2){animation-delay:.2s} .dot:nth-child(3){animation-delay:.4s}
@keyframes pulse{0%,80%,100%{opacity:0.3}40%{opacity:1}}

/* SEARCH RESULTS */
.search-results { }
.search-result-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; transition: all 0.15s; }
.search-result-item:hover { border-color: var(--accent); }
.search-result-name { font-size: 15px; font-weight: 500; }
.search-result-hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.search-result-cat { font-size: 12px; color: var(--hint); }
.search-result-arrow { color: var(--hint); font-size: 18px; }

/* FOOTER */
footer { background: var(--accent-dark); color: rgba(255,255,255,0.7); padding: 3rem 1.5rem; text-align: center; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-logo { font-family: 'Lora', serif; font-size: 20px; color: white; margin-bottom: 0.75rem; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin: 1rem 0; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,0.6); }
.footer-links a:hover { color: white; }
.footer-copy { font-size: 12px; opacity: 0.5; margin-top: 1rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .container { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .nav-links { display: none; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr; }
  .terms-grid { grid-template-columns: 1fr 1fr; }
}
