/* ============================================
   DESIGN SYSTEM — jetztrechnen.de
   Direction: Swiss Precision
   Light theme, warm accent, number-forward
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Surface */
  --bg-page: #F8F7F4;
  --bg-card: #FFFFFF;
  --bg-input: #F2F1ED;
  --bg-result: #FFF8EE;
  --bg-nav: #FFFFFF;
  --bg-footer: #1A1A1A;
  --bg-category-tag: #EEEDEA;
  --bg-faq-hover: #F2F1ED;

  /* Accent */
  --accent: #E08A1E;
  --accent-hover: #C8780F;
  --accent-light: #FFF3E0;
  --accent-glow: rgba(224, 138, 30, 0.08);

  /* Text */
  --text-primary: #1A1A1A;
  --text-secondary: #6B6860;
  --text-tertiary: #9C9890;
  --text-on-dark: #F8F7F4;
  --text-on-accent: #FFFFFF;
  --text-result: #1A1A1A;
  --text-link: #E08A1E;

  /* Borders */
  --border: #E5E4E0;
  --border-input: #D4D3CF;
  --border-input-focus: #E08A1E;
  --border-card: #EEEDEA;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-nav: 0 1px 0 rgba(0,0,0,0.06);
  --shadow-result: 0 0 0 1px rgba(224, 138, 30, 0.15), 0 2px 8px rgba(224, 138, 30, 0.06);

  /* Spacing scale (4px base) */
  --s1: 4px;   --s2: 8px;   --s3: 12px;
  --s4: 16px;  --s5: 20px;  --s6: 24px;
  --s7: 28px;  --s8: 32px;  --s10: 40px;
  --s12: 48px; --s16: 64px; --s20: 80px;

  /* Type scale */
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Layout */
  --max-width: 720px;
  --nav-height: 56px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3 { line-height: 1.25; font-weight: 600; }

h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h2 {
  font-size: var(--text-lg);
  margin-top: var(--s12);
  margin-bottom: var(--s4);
  color: var(--text-primary);
}

h3 {
  font-size: var(--text-md);
  margin-top: var(--s8);
  margin-bottom: var(--s3);
}

p { margin-bottom: var(--s4); color: var(--text-secondary); }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--accent-hover); }

/* --- Navigation (Floating Pill — matches homepage) --- */
.nav-spacer {
  height: 72px;
}

.nav {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1140px;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 4px 16px rgba(0,0,0,0.06),
    0 12px 40px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.8);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav.scrolled {
  top: 6px;
  width: calc(100% - 24px);
  background: rgba(255,255,255,0.92);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.05),
    0 8px 24px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.9);
  border-radius: 14px;
}

.nav-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 8px 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  z-index: 2;
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #E08A1E 0%, #D17A10 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
  box-shadow:
    0 2px 8px rgba(224,138,30,0.3),
    0 0 0 2.5px rgba(224,138,30,0.1);
  transition: all 0.3s ease;
}

.nav-brand:hover .nav-brand-icon {
  box-shadow:
    0 4px 14px rgba(224,138,30,0.4),
    0 0 0 3px rgba(224,138,30,0.15);
  transform: translateY(-1px);
}

.nav-brand-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.nav-brand-tld {
  color: var(--accent);
  font-size: 13px;
  opacity: 0.6;
  position: relative;
  top: -1px;
}

/* Center nav links */
.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.nav-link-icon {
  font-size: 13px;
  opacity: 0.55;
  transition: opacity 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover .nav-link-icon {
  opacity: 0.85;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
}

.nav-alle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px 7px 12px;
  background: var(--text-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.nav-alle-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(224,138,30,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
}

.nav-alle-btn:hover {
  background: #2a2a2a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,26,26,0.2);
}

.nav-alle-btn:hover::before {
  opacity: 1;
}

.nav-alle-grid {
  display: grid;
  grid-template-columns: repeat(2, 3px);
  grid-template-rows: repeat(2, 3px);
  gap: 2px;
  opacity: 0.7;
}

.nav-alle-grid span {
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
}

.nav-alle-chevron {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.25s ease;
  margin-left: 2px;
}

.nav-alle-btn.open .nav-alle-chevron {
  transform: rotate(180deg);
}

/* Mega menu dropdown */
.mega-menu {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: calc(100% - 48px);
  max-width: 920px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.05),
    0 16px 48px rgba(0,0,0,0.1),
    0 0 0 1px rgba(255,255,255,0.5);
  padding: 24px 28px 20px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.mega-menu.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.mega-menu-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.mega-menu-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-page);
  padding: 3px 10px;
  border-radius: 100px;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mega-menu-cat-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  padding: 4px 10px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mega-menu-cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mega-menu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.mega-menu-link:hover {
  background: var(--bg-page);
}

.mega-menu-link-icon {
  font-size: 14px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.mega-menu-link-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mega-menu-link-vol {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.15s;
}

.mega-menu-link:hover .mega-menu-link-vol {
  opacity: 1;
}

/* Mega menu backdrop */
.mega-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.08);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mega-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Hamburger button */
.nav-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  transition: background 0.2s;
}

.nav-hamburger:hover {
  background: rgba(0,0,0,0.04);
}

.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Mobile menu panel */
.mobile-menu {
  position: fixed;
  top: 68px;
  left: 16px;
  right: 16px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 16px;
  z-index: 99;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.mobile-menu.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu-section {
  margin-bottom: 12px;
}

.mobile-menu-section:last-child {
  margin-bottom: 0;
}

.mobile-menu-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  padding: 4px 8px 8px;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s;
}

.mobile-menu-link:hover {
  background: var(--bg-page);
}

.mobile-menu-link-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
}

.mobile-menu-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 8px 0;
}

/* --- Breadcrumb --- */
.breadcrumb {
  max-width: var(--max-width);
  margin: var(--s4) auto var(--s1);
  padding: 0 var(--s5);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--text-link); }
.breadcrumb .sep { margin: 0 var(--s1); }

/* --- Page Header --- */
.page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s4);
}
.page-header h1 { margin-bottom: var(--s2); }
.page-header .subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* --- Calculator Card --- */
.calc-card {
  max-width: var(--max-width);
  margin: 0 auto var(--s6);
  padding: 0 var(--s5);
}

.calc-card-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: fadeUp 0.3s ease-out;
}

/* Calculator mode tabs */
.calc-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.calc-tabs::-webkit-scrollbar { display: none; }

.calc-tab {
  flex: 1;
  min-width: max-content;
  padding: var(--s3) var(--s4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-body);
}
.calc-tab:hover { color: var(--text-primary); }
.calc-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Calculator body */
.calc-body { padding: var(--s6) var(--s5); }

.calc-panel { display: none; }
.calc-panel.active { display: block; }

/* Input groups */
.input-group { margin-bottom: var(--s5); }

.input-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--s2);
}

.input-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.input-row .connector {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: 500;
  flex-shrink: 0;
}

.calc-input {
  width: 100%;
  padding: var(--s3) var(--s4);
  font-size: var(--text-lg);
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  -moz-appearance: textfield;
}
.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input:focus {
  border-color: var(--border-input-focus);
  background: var(--bg-card);
}
.calc-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.calc-select {
  width: 100%;
  padding: var(--s3) var(--s4);
  font-size: var(--text-base);
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239C9890' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s4) center;
  transition: border-color 0.15s;
}
.calc-select:focus { border-color: var(--border-input-focus); }

/* Unit suffix inside input */
.input-with-unit { position: relative; }
.input-with-unit .calc-input { padding-right: var(--s10); }
.input-with-unit .unit {
  position: absolute;
  right: var(--s4);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  pointer-events: none;
}

/* Toggle buttons (MwSt rate, gender, etc.) */
.toggle-group {
  display: flex;
  gap: var(--s2);
  margin-bottom: var(--s5);
}
.toggle-btn {
  flex: 1;
  padding: var(--s2) var(--s4);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.toggle-btn.active {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--accent);
}

/* Result display */
.result-box {
  margin-top: var(--s5);
  padding: var(--s5);
  background: var(--bg-result);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-result);
  text-align: center;
}

.result-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--s2);
}

.result-value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-result);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.result-detail {
  margin-top: var(--s3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.result-breakdown {
  margin-top: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  text-align: left;
}

.result-section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s1);
  margin-top: var(--s4);
}
.result-section-label:first-child { margin-top: 0; }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s2) 0;
  font-size: var(--text-sm);
}
.result-row:not(:last-child) {
  border-bottom: 1px solid rgba(224, 138, 30, 0.1);
}
.result-row .row-label { color: var(--text-secondary); }
.result-row .row-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}
.result-row.total .row-label { color: var(--text-primary); font-weight: 600; }
.result-row.total .row-value { font-size: var(--text-lg); }

/* Formula display */
.formula-display {
  margin-top: var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
  overflow-x: auto;
}

/* --- Content Sections --- */
.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--s5);
}

.content h2 {
  padding-top: var(--s8);
  border-top: 1px solid var(--border);
}

.content p {
  font-size: var(--text-base);
  line-height: 1.7;
}

.content ul, .content ol {
  padding-left: var(--s6);
  margin-bottom: var(--s4);
  color: var(--text-secondary);
}
.content li { margin-bottom: var(--s2); }

/* Example box */
.example-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--s4) var(--s5);
  margin: var(--s4) 0;
}

.example-box .example-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--s2);
}

.example-box .example-calc {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--accent);
  line-height: 1.8;
}

/* --- FAQ Section --- */
.faq-list { list-style: none; }

.faq-item { border-bottom: 1px solid var(--border); }

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s4) 0;
  font-size: var(--text-base);
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: var(--s4);
  transition: color 0.15s;
}
.faq-question:hover { color: var(--accent); }

.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding-bottom: var(--s4);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* --- Weitere Rechner --- */
.related-tools {
  max-width: var(--max-width);
  margin: var(--s12) auto var(--s8);
  padding: 0 var(--s5);
}

.related-tools h2 {
  margin-top: 0;
  margin-bottom: var(--s5);
  padding-top: var(--s8);
  border-top: 1px solid var(--border);
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}

.tool-card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: box-shadow 0.2s, border-color 0.15s;
}
.tool-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-input);
}

.tool-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: var(--text-lg);
}

.tool-info { min-width: 0; }

.tool-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Disclaimer --- */
.disclaimer {
  margin-top: var(--s4);
  padding: var(--s3) var(--s4);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  border-left: 2px solid var(--border);
  line-height: 1.6;
}

/* --- Traffic Light (Promillerechner, BMI, etc.) --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--text-sm);
  margin-top: var(--s3);
}
.status-badge.green { background: #ECFDF5; color: #059669; }
.status-badge.yellow { background: #FFFBEB; color: #D97706; }
.status-badge.red { background: #FEF2F2; color: #DC2626; }

/* --- Gauge bar --- */
.gauge-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 99px;
  margin-top: var(--s4);
  overflow: hidden;
}
.gauge-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s, background 0.3s;
  min-width: 0;
}

/* --- Data table (penalties, Düsseldorfer Tabelle, etc.) --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: var(--s4) 0;
}
.data-table th, .data-table td {
  padding: var(--s2) var(--s3);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}
.data-table td { color: var(--text-primary); }

/* --- Drink rows (Promillerechner) --- */
.drink-rows { display: flex; flex-direction: column; gap: var(--s2); }
.drink-row {
  display: grid;
  grid-template-columns: 1fr 72px 36px;
  gap: var(--s2);
  align-items: center;
}
.drink-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #DC2626;
  cursor: pointer;
  font-size: var(--text-lg);
  padding: var(--s2);
  transition: background 0.15s;
}
.drink-remove:hover { background: #FEF2F2; }
.drink-add {
  background: var(--accent-glow);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  padding: var(--s3);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  text-align: center;
  transition: background 0.15s;
  margin-top: var(--s2);
}
.drink-add:hover { background: var(--accent-light); }

/* --- Homepage --- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--s10) var(--s5) var(--s6);
  text-align: center;
}
.hero h1 { margin-bottom: var(--s3); }
.hero .subtitle { max-width: 480px; margin: 0 auto; }

.home-section {
  max-width: 960px;
  margin: 0 auto var(--s8);
  padding: 0 var(--s5);
}
.home-section h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--s4);
  color: var(--text-primary);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s3);
}

.home-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: box-shadow 0.2s, border-color 0.15s;
}
.home-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-input);
}

.home-card .tool-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.home-card .card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.home-card .card-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.5;
}

/* --- Legal pages --- */
.legal-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--s8) var(--s5) var(--s16);
}
.legal-content h1 { margin-bottom: var(--s6); }
.legal-content h2 {
  font-size: var(--text-md);
  margin: var(--s8) 0 var(--s3);
}
.legal-content p { font-size: var(--text-base); color: var(--text-secondary); }
.legal-content ul { padding-left: var(--s6); color: var(--text-secondary); margin-bottom: var(--s4); }

/* --- Footer --- */
.footer {
  margin-top: var(--s16);
  padding: var(--s8) var(--s5);
  background: var(--bg-footer);
  color: var(--text-on-dark);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--s6);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-on-dark);
}

.footer-links {
  display: flex;
  gap: var(--s6);
  list-style: none;
}
.footer-links a {
  font-size: var(--text-sm);
  color: rgba(248, 247, 244, 0.6);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text-on-dark); }

.footer-bottom {
  padding-top: var(--s5);
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: var(--text-xs);
  color: rgba(248, 247, 244, 0.4);
}

/* --- Responsive --- */
@media (min-width: 640px) {
  h1 { font-size: var(--text-3xl); }
  .calc-body { padding: var(--s8) var(--s6); }
  .result-value { font-size: var(--text-4xl); }
  .tools-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 768px) {
  .input-row { gap: var(--s4); }
}

/* Tablet: hide center links & alle btn, show hamburger */
@media (max-width: 860px) {
  .nav-center { display: none; }
  .nav-alle-btn { display: none; }
  .nav-hamburger { display: flex; }
  .mega-menu { display: none; }
  .mega-backdrop { display: none; }
  .nav-hamburger {
    width: 44px;
    height: 44px;
  }
  .mobile-menu-link {
    min-height: 44px;
    padding: 12px 12px;
  }
}

@media (min-width: 1024px) {
  :root { --max-width: 760px; }
}

/* --- Utilities --- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* --- Mobile (max 640px) --- */
@media (max-width: 639px) {
  h1 { font-size: var(--text-xl); }
  .result-value { font-size: var(--text-2xl); }

  .page-header { padding: var(--s4) var(--s4) var(--s3); }
  .calc-card { padding: 0 var(--s3); }
  .calc-body { padding: var(--s4) var(--s3); }
  .content { padding: 0 var(--s4); }
  .related-tools { padding: 0 var(--s4); }
  .breadcrumb { padding: 0 var(--s4); }

  .calc-tab { padding: var(--s2) var(--s3); font-size: var(--text-xs); }
  .calc-input { font-size: var(--text-md); padding: var(--s3); }

  .input-row { flex-direction: column; gap: var(--s2); }
  .input-row .connector { display: none; }

  .tools-grid { grid-template-columns: 1fr; gap: var(--s2); }

  .result-box { padding: var(--s4); }
  .result-breakdown { font-size: var(--text-xs); }

  .faq-question { font-size: var(--text-sm); padding: var(--s3) 0; }
  .faq-answer { font-size: var(--text-sm); }

  .example-box { padding: var(--s3) var(--s4); }
  .example-box .example-calc { font-size: var(--text-sm); }
  .formula-display { font-size: var(--text-xs); padding: var(--s2) var(--s3); }

  .data-table { font-size: var(--text-xs); }
  .data-table th, .data-table td { padding: var(--s1) var(--s2); }

  .drink-row { grid-template-columns: 1fr 60px 32px; }

  .toggle-group { flex-wrap: wrap; }
  .toggle-btn { font-size: var(--text-xs); padding: var(--s2) var(--s3); }

  .footer-inner { padding: 0 var(--s4); }
  .footer-top { flex-direction: column; align-items: center; gap: var(--s3); }

  .nav {
    width: calc(100% - 32px);
    top: 8px;
    border-radius: 12px;
  }
  .nav-inner {
    padding: 0 8px 0 12px;
  }
  .nav-spacer { height: 64px; }
  .nav-brand-text { font-size: 15px; }
  .nav-brand-tld { font-size: 11px; }
  .nav-brand-icon { width: 32px; height: 32px; font-size: 12px; }
  .mobile-menu { top: 60px; left: 16px; right: 16px; }

  .home-grid { grid-template-columns: 1fr; }

  .hero { padding: var(--s6) var(--s4) var(--s4); }
  .hero h1 { font-size: var(--text-xl); }

  /* --- Overflow prevention --- */
  /* Constrain all major containers to viewport */
  .page-header,
  .calc-card,
  .content,
  .related-tools,
  .breadcrumb,
  .hero,
  .home-section,
  .legal-content {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Prevent calc-card-inner from exceeding its parent */
  .calc-card-inner {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Result value: prevent large numbers from overflowing */
  .result-value {
    word-break: break-all;
    overflow-wrap: break-word;
  }

  /* Result rows: prevent long labels/values from overflowing */
  .result-row {
    flex-wrap: wrap;
    gap: var(--s1);
  }
  .result-row .row-value {
    word-break: break-all;
  }

  /* FAQ: prevent long question text from overflowing */
  .faq-question {
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
  }
  .faq-answer {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Example box: prevent formula overflow */
  .example-box {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
  }
  .example-box .example-calc {
    word-break: break-all;
    overflow-wrap: break-word;
  }

  /* Data table: horizontal scroll wrapper */
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Formula display: already has overflow-x auto, ensure max-width */
  .formula-display {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-all;
  }

  /* Tool cards: prevent text from pushing card wider */
  .tool-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .tool-info {
    min-width: 0;
    overflow: hidden;
  }

  /* Content: prevent any child from overflowing */
  .content p,
  .content li {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Disclaimer: prevent overflow */
  .disclaimer {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
  }

  /* Footer links: wrap on mobile */
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s3) var(--s5);
  }

  /* Gauge: ensure it stays within bounds */
  .gauge-wrap {
    max-width: 100%;
  }

  /* Status badge: wrap text if needed */
  .status-badge {
    word-break: break-word;
    max-width: 100%;
  }

  /* Drink rows: prevent overflow on narrow screens */
  .drink-rows {
    max-width: 100%;
  }
}

/* --- Small phone (max 374px) --- */
@media (max-width: 374px) {
  h1 { font-size: var(--text-lg); }
  .result-value { font-size: var(--text-xl); }
  .calc-body { padding: var(--s3) var(--s2); }
  .content { padding: 0 var(--s3); }
  .related-tools { padding: 0 var(--s3); }
  .breadcrumb { padding: 0 var(--s3); }
  .page-header { padding: var(--s3) var(--s3) var(--s2); }
  .calc-card { padding: 0 var(--s2); }
  .nav-brand-icon { width: 28px; height: 28px; font-size: 11px; }
  .nav-brand-text { font-size: 14px; }

  /* Extra tight spacing for small phones */
  .example-box { padding: var(--s2) var(--s3); }
  .result-box { padding: var(--s3); }
  .toggle-btn { padding: var(--s1) var(--s2); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
