/* ========================================================= */
/* == 1. DESIGN TOKENS (DARK & LIGHT THEMES)              == */
/* ========================================================= */
:root {
  /* Surface Levels (Dark Mode Default) */
  --bg-body: #121212;
  --bg-surface-1: #1e1e1e;
  --bg-surface-2: #252525;
  --bg-surface-3: #2a2a2a;
  --border-subtle: #444444;

  /* Text Hierarchy */
  --text-primary: #e0e0e0;
  --text-muted: #a0a0a0;
  --text-dark: #000000;

  /* Material-Desaturated Accents */
  --accent-green: #43bd88;
  --accent-green-glow: rgba(67, 189, 136, 0.4);

  --accent-pink: #e65bc3;
  --accent-pink-glow: rgba(230, 91, 195, 0.4);

  --accent-blue: #2e95d3;
  --accent-blue-glow: rgba(46, 149, 211, 0.4);
}

/* Light Mode (The Rich Translation) */
[data-theme="light"] {
  --accent-green: #238f63;
  --accent-pink: #c22b9c;
  --accent-blue: #1a70a8;
}


/* Light Mode Overrides */
[data-theme="light"] {
  --bg-body: #f4f5f7;
  --bg-surface-1: #ffffff;
  --bg-surface-2: #f8f9fa;
  --bg-surface-3: #eef0f4;
  --border-subtle: #d1d5db;

  --text-primary: #1a1a1a;
  --text-muted: #666666;

  --accent-green: #278a5e;
  --accent-pink: #b83296;
  --accent-blue: #1c6ba0;
}


[data-theme="light"] body {
  color: #111111;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  
}


/* 1. Deepen the Grey Variables for Light Mode */
[data-theme="light"] {
  --text-muted: #5c5c5c;     /* A sturdy, readable grey instead of a washed-out one */
  --border-subtle: #d1d5db;
}


/* Apply optical weight boost to light-themed containers AND their buttons */
[data-theme="light"] main,
[data-theme="light"] .toc,
[data-theme="light"] .toc .standard-button,
[data-theme="light"] .toc .vocab-meta-box,
[data-theme="light"] p,
[data-theme="light"] li {
  font-weight: 350;
}

/* 2. Optical Weight Boost for Colored & Grey Text */
[data-theme="light"] .color-green,
[data-theme="light"] .color-blue,
[data-theme="light"] .color-pink,
[data-theme="light"] .sub-text,
[data-theme="light"] .annotation {
  font-weight: 390; /* ~100 higher than your base 380 text */
}

/* Optical Weight Boost & Color Adjustment for Grey Text in Light Mode */
[data-theme="light"] .color-grey {
  color: #555555;      /* A sturdy, mid-dark grey that maintains clear contrast */
  font-weight: 380;    /* Thickens the font strokes so it holds up next to green/blue */
}


/* ========================================================= */
/* == LIGHT MODE HOVER OVERRIDES (.icon-link & FOOTER)    == */
/* ========================================================= */

[data-theme="light"] .icon-link:hover,
[data-theme="light"] .icon-link:active {
  color: var(--accent-blue);
  background-color: var(--bg-surface-3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .footer-utility-button:hover,
[data-theme="light"] .footer-utility-button:active {
  color: var(--text-primary);
  background-color: var(--bg-surface-3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}


/* ========================================================= */
/* == 2. GLOBAL RESET & BASE TYPOGRAPHY                   == */
/* ========================================================= */
*, *::before, *::after {
  box-sizing: border-box; /* Fixed typo from border-border-box */
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 50px;
}

body {
  font-family: 'Noto Sans', sans-serif;
  font-weight: 300;
  font-size: 22px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* Color Utility Classes */
.color-green { color: var(--accent-green); font-weight: 300; }
.color-pink  { color: var(--accent-pink); font-weight: 300; }
.color-blue  { color: var(--accent-blue); font-weight: 300; }
.color-grey  { color: var(--text-muted); font-weight: 300; }


.meta-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.85em;
  color: var(--text-muted);
  font-weight: 300;
}

/* Color Utility Classes */
.color-green, .highlight-green { color: var(--accent-green); font-weight: 300; }
.color-pink,  .highlight-pink  { color: var(--accent-pink);  font-weight: 300; }
.color-blue,  .highlight-blue  { color: var(--accent-blue);  font-weight: 300; }
.color-grey,  .highlight-grey  { color: var(--text-muted);   font-weight: 300; }


/* ========================================================= */
/* == 3. LAYOUT CONTAINERS                                == */
/* ========================================================= */
main {
max-width: 940px; /* Increased from 880px */
  margin: 0 auto 40px auto;
  padding: 30px;
  background-color: var(--bg-surface-1);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.layout-clean main {
  background-color: transparent;
  box-shadow: none;
}

.content-unit {
  position: relative;
  background-color: var(--bg-surface-1);
  border: none; /* Removes the flat border outline */
  border-radius: 6px;
  padding: 20px;
  margin: 40px 0;
  /* Dual-layer shadow gives depth in light mode without muddying colors */
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Deepen the shadow depth when dark theme is active */
[data-theme="dark"] .content-unit {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.content-pink {
  position: relative;
  display: block;
  background-color: var(--bg-surface-2);
  border: none;
  border-left: 1.5px solid var(--accent-pink); /* Preserved accent bar */
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 30px 0;
  /* Dual-layer shadow for light mode elevation */
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Deepened shadow depth for dark theme */
[data-theme="dark"] .content-pink {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.content-blue {
  position: relative;
  display: block;
  background-color: var(--bg-surface-2);
  border: none;
  border-left: 1.5px solid var(--accent-blue); /* 1.5px blue left accent bar */
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 30px 0;
  /* Faux 3D double-shadow for light mode */
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Deepen the shadow depth when dark theme is active */
[data-theme="dark"] .content-blue {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
}


/* Layout Helper for Pink Boxes with Vertically Centered Roman Numerals */
.content-pink.has-numeral {
  display: flex;
  align-items: center; /* Vertically centers the Roman numeral next to the pink line */
  gap: 16px;
}



.content-pink__body {
  flex-grow: 1;
}

.content-pink__body ul:last-child,
.content-pink__body p:last-child {
  margin-bottom: 0;
}

/* ========================================================= */
/* == 4. SPRACHKOMPETENZ TABLES                           == */
/* ========================================================= */

/* Dark Clean Table */
.page-sprachkompetenz main .table-clean-dark {
  width: 100%;
  margin: 40px 0;
  border-collapse: collapse;
  background-color: var(--bg-surface-2);
}

.page-sprachkompetenz main .table-clean-dark td,
.page-sprachkompetenz main .table-clean-dark th {
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-weight: 300;
  padding: 15px;
  vertical-align: middle;
}

/* Comparison Table */
.page-sprachkompetenz main .table-comparison {
  width: 100%;
  border-collapse: collapse;
  margin: 70px 0;
}

.page-sprachkompetenz main .table-comparison td {
  border: none;
  padding: 15px;
  vertical-align: top;
  width: 50%;
}

.page-sprachkompetenz main .table-comparison td:first-child {
  border-right: 1px solid var(--accent-blue);
}





/* ========================================================= */
/* == 5. PERSISTENT SITEMAP (LEFT SIDEBAR)                == */
/* ========================================================= */
@media (min-width: 1300px) {
  body.layout-clean {
    padding-left: 220px;  /* Space for left sitemap */
    padding-right: 220px; /* Balances layout so content stays centered */
    
  }

  .persistent-sitemap {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    background-color: var(--bg-surface-1);
    box-shadow: 3px 0 7px rgba(0, 0, 0, 0.4);
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 100;
  }

  .sitemap-home-button-container {
    text-align: center;
    padding-top: 35px;
    flex-shrink: 0;
  }

  .sitemap-content-wrapper {
    margin-top: auto;
    margin-bottom: auto;
    flex-shrink: 0;
    overflow-y: auto;
  }

  .persistent-sitemap .sitemap-header {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 1.5px;
    margin: 30px 0 0px 0;
    padding-left: 10px;
  }

  .persistent-sitemap .sitemap-button {
    display: block;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.1px;
    line-height: 1.2;
    padding: 3px 25px 3px 10px;
    margin-bottom: 2px;
    text-align: left;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 4px;
    position: relative;
    transition: color 0.2s ease-in-out;
  }

  .persistent-sitemap .sitemap-button:hover {
    color: #ffffff;
  }

  /* Active indicator emoji (👈) */
  .persistent-sitemap .sitemap-button[data-page]::before {
    content: '👈';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    display: none;
  }

  .page-sprachkompetenz .sitemap-button[data-page="sprachkompetenz"]::before {
    display: block;
  }

  .page-sprachkompetenz .sitemap-button[data-page="sprachkompetenz"] {
    color: #ffffff;
  }

  .sitemap-impressum-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
    padding-bottom: 35px;
    flex-shrink: 0;
  }

  .sitemap-lernplan-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: none;
    background-color: var(--bg-surface-2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease-out;
  }

  .sitemap-lernplan-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 0 10px var(--accent-green-glow);
  }

/* ADD IT RIGHT HERE (inside the closing bracket below): */
  .mobile-only-home {
    display: none !important;
  }
  
}

/* Hide Sidebar on tablet and mobile */
@media (max-width: 1299px) {
  .persistent-sitemap {
    display: none !important;
  }
}

/* ========================================================= */
/* == 6. HEADER & TABLE OF CONTENTS (TOC)                 == */
/* ========================================================= */
.header-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
}

.layout-clean .header-content {
max-width: 940px; /* Increased from 880px */
  padding: 0 30px;
  margin: 0 auto;
}

.layout-clean .toc {
  background-color: transparent;
  box-shadow: none;
  padding: 20px 30px;
max-width: 940px; /* Increased from 880px */
  margin: 0 auto;
}

.layout-clean .toc ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  margin: 0;
  list-style-type: none;
}

.layout-clean .toc li {
  width: 100%;
  max-width: 380px;
  margin: 0;
}

/* Standard Button inside TOC */
.toc-clean .standard-button {
  display: block;
  width: 380px;
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
  padding: 6.5px 15px;
  line-height: 1.4;
  border-radius: 6px;
  font-weight: 300;
  color: var(--text-primary);
  text-decoration: none;
  background-color: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease-out;
}

/* Base TOC Button Hover (Default Green for APG pages) */
.toc .standard-button:hover {
  color: var(--accent-green);
  transform: translateY(-1px);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

/* Category Hover Overrides */
.page-brief .toc .standard-button:hover {
  color: var(--accent-pink);
  box-shadow: 0 0 10px var(--accent-pink-glow);
}

.page-aag .toc .standard-button:hover,
.page-sprachkompetenz .toc .standard-button:hover,
.page-sprechkompetenz .toc .standard-button:hover {
  color: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow);
}

/* TOC Item Wrapper & Action Buttons (Left side of TOC) */
.toc-item-wrapper {
  position: relative;
  width: 380px;
  margin: 0 auto;
}

.toc-left-actions {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 15px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.vocab-meta-box {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
  white-space: nowrap;
}

.toc-icon-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background-color: var(--bg-surface-2);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  border: none;
  text-decoration: none;
  font-size: 1.4em;
  cursor: pointer;
  transition: all 0.2s ease-out;
}

.glow-speech:hover {
  box-shadow: 0 0 10px var(--accent-pink-glow) !important;
  transform: translateY(-1px);
}

.glow-puzzle:hover {
  box-shadow: 0 0 10px var(--accent-green-glow) !important;
  transform: translateY(-1px);
}

.toc-icon-spacer {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

/* Sticky Gutter Action Buttons (Scrolled view next to headers) */
.section-container {
  position: relative;
}

.section-container {
  position: relative;
  overflow: visible;
}


.gutter-anchor-wrapper {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
}

.floating-gutter-btn {
  position: sticky;
  top: 50px;
  margin-top: 0;
  margin-left: -55px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background-color: var(--bg-surface-2);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  border: none;
  text-decoration: none;
  font-size: 1.4em;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease-out;
}

/* Tighten header-to-TOC spacing on clean layouts */
.layout-clean .header-centered {
  padding-bottom: 5px;
}

.layout-clean .header-centered h1 {
  margin-bottom: 5px;
}

.layout-clean .toc {
  padding-top: 10px;
}

@media (max-width: 1299px) {
  .floating-gutter-btn,
  .toc-left-actions {
    display: none;
  }
}

/* ========================================================= */
/* == 7. SEMI-PERSISTENT PAGEMAP (RIGHT SIDEBAR)          == */
/* ========================================================= */
@media (min-width: 1300px) {
  .semi-persistent-pagemap {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: var(--bg-surface-1);
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    z-index: 100;
  }

  .semi-persistent-pagemap.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .pagemap-link {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-muted);
    text-decoration: none;
    text-align: right;
    position: relative;
    padding: 2px 0 2px 20px;
    transition: color 0.2s ease-out;
  }

  .pagemap-link:hover {
    color: #ffffff;
  }

  .pagemap-link.active {
    color: #ffffff;
  }

  .pagemap-link.active::before {
    content: '🙂';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
  }
}

@media (max-width: 1299px) {
  .semi-persistent-pagemap {
    display: none !important;
  }
}


/* ========================================================= */
/* == DARK SIDEBAR LOCK (SITEMAP & PAGEMAP ALWAYS DARK)   == */
/* ========================================================= */

.persistent-sitemap,
.semi-persistent-pagemap {
  background-color: #1e1e1e !important;
}

/* Left Sitemap: Directional shadow casting outward to the right */
.persistent-sitemap {
  box-shadow: 3px 0 7px rgba(0, 0, 0, 0.5) !important;
}

/* Right Pagemap: Floating omnidirectional 3D depth */
.semi-persistent-pagemap {
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Sitemap Links & Headers */
.persistent-sitemap .sitemap-button,
.pagemap-link {
  color: #cccccc !important;
}

.persistent-sitemap .sitemap-button:hover,
.pagemap-link:hover,
.pagemap-link.active {
  color: #ffffff !important;
}

/* Sitemap Bottom Buttons */
.sitemap-lernplan-btn {
  background-color: #2a2a2a !important;
  background-image: linear-gradient(to bottom, #333333, #2a2a2a) !important;
  color: #e0e0e0 !important;
}

.sitemap-lernplan-btn:hover {
  color: #ffffff !important;
}

/* ========================================================= */
/* == HOME BUTTON (GRADIENT, ICON & DUAL GLOW)            == */
/* ========================================================= */
.home-button-gradient {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  cursor: pointer;
  background-image: linear-gradient(to bottom, #555555, #4a4a4a);
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  transition: transform 0.15s ease-out, background-image 0.15s ease-out, box-shadow 0.3s ease-in-out;
}

/* Hover: Lift, Darker Gradient, and Blue-Green Glow */
.home-button-gradient:hover {
  transform: translateY(-1px);
  background-image: linear-gradient(to bottom, #434343, #373737);
  box-shadow: 
    0 -2px 12px 1px rgba(46, 149, 211, 0.7),  /* Top Blue Glow */
    0 2px 7px 0 rgba(67, 189, 136, 0.7);     /* Bottom Green Glow */
}

/* SVG House Icon & Hover Stroke Refinement */
.home-button-gradient svg {
  width: 24px;
  height: 24px;
}

.home-button-gradient svg path {
  fill: none;
  stroke: #0a0a0a;
  stroke-width: 3px;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: stroke 0.15s ease-out, stroke-width 0.15s ease-out;
}

.home-button-gradient:hover svg path {
  stroke: #b1b1b1;
  stroke-width: 2px;
}


/* ========================================================= */
/* == 8. HEADINGS & TYPOGRAPHY                            == */
/* ========================================================= */
h1 {
  color: var(--text-primary);
  font-weight: 300;
  text-align: center;
  margin: 10px auto 15px auto;
  max-width: 900px;
}

/* Green section headings for standard pages */
h2, h3 {
  color: var(--accent-green);
  font-weight: 300;
  margin-top: 150px;
  margin-bottom: 15px;
}

/* Remove top margin from the very first h2/h3 inside main */
main > section:first-child > h2:first-child,
main > h2:first-of-type,
main > h3:first-of-type {
  margin-top: 0;
}

/* Page-specific override for Sprachkompetenz headings */
.page-sprachkompetenz h2,
.page-sprachkompetenz h3 {
  color: var(--accent-pink);
}

/* ========================================================= */
/* == 9. LINK BUTTONS & ACTION LINKS                      == */
/* ========================================================= */
.icon-link {
  display: flex;                /* Changed from inline-flex so buttons stack vertically */
  align-items: center;
  justify-content: center;
  width: fit-content;           /* Each button shrinks to fit its own text */
  max-width: 100%;              /* Prevents mobile overflow */
  box-sizing: border-box;
  margin: 8px 0;                /* Generates clean vertical spacing between stacked buttons */
  padding: 8px 16px;
  font-size: 0.95em;
  background-color: var(--bg-surface-2);
  border-radius: 4px;
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease-out;
  cursor: pointer;
}

.icon-link:hover,
.icon-link:active {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.75);
}

/* Base Anchor Reset */
a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--accent-pink);
}

/* Context Links (Internal Jumps / Section Links) */
a.context-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 390; /* Optical weight for clear legibility */
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

a.context-link:hover {
  color: var(--accent-pink);
  text-decoration: underline;
}

/* External Links (Wikipedia, external references) */
a.external-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 390;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

a.external-link::after {
  content: " ↗";
  display: inline-block;
  margin-left: 3px;
  font-size: 0.85em;
  text-decoration: none;
}

a.external-link:hover {
  color: var(--accent-pink);
}


/* ========================================================= */
/* == 10. LIST STYLES                                     == */
/* ========================================================= */
ul {
  list-style-type: disc;
  padding-left: 30px;
  margin-bottom: 50px;
}

li {
  margin-bottom: 15px;
  line-height: 1.4;
}

ul.list-plain {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 5px;
}

ul.list-blue-bullets li::marker {
  color: var(--accent-blue);
}





/* ========================================================= */
/* == TABLE WRAPPERS & TITLE CLEARANCE                     == */
/* ========================================================= */
/* Replace the old .table-wrapper block with this: */
.table-wrapper {
  position: relative;
  margin: 40px 0;
}

/* Automatically adds 90px top clearance when a title badge is present */
.table-wrapper:has(.table-title) {
  margin-top: 90px;
}

.table-title {
  position: absolute;
  top: -3.6em;
  left: 0;
  background-color: var(--bg-body);
  padding: 0 5px;
  font-weight: bold;
  color: var(--text-primary);
}

.table-title.title-align-col2 {
  left: 20%;
}


/* ========================================================= */
/* == MEGA VERB TABLES (6 COLUMNS)                        == */
/* ========================================================= */
.table-verb-mega {
    width: 100%;
    table-layout: auto; 
}

/* Merged Header Row (Row 1) */
.table-verb-mega thead th {
    text-align: center;
    font-weight: 400; 
}

/* Emoji Column (Column 1) */
.table-verb-mega tbody td:first-child {
    width: 45px;
    text-align: center;
    vertical-align: middle;
    /* The vertical line is now drawn automatically by .table-cols-divided */
}

/* Shrinks the metadata columns (Columns 3, 4, 5, 6) */
.table-verb-mega tbody td:nth-child(n+3) {
    font-size: 0.85em;
    vertical-align: middle; 
}

/* Group Separator Line */
.table-verb-mega tr.group-separator td {
    border-bottom: 1.25px solid var(--text-muted) !important;
}


/* ========================================================= */
/* == 12. UTILITY CLASSES & SEPARATORS                    == */
/* ========================================================= */
hr.subject-separator {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 40px 0;
}

.annotation {
  color: var(--text-muted);
  font-size: 0.8em;
  vertical-align: super;
  font-style: italic;
  font-weight: 300;
}

.no-wrap {
  white-space: nowrap;
}

.text-center {
  text-align: center;
}

.extra-space-before {
  margin-top: 140px;
}

.extra-space-after {
  margin-bottom: 130px;
}

/* ========================================================= */
/* == BOX WIDTH MODIFIERS                                 == */
/* ========================================================= */

/* Shrinks the box to fit its content while preventing mobile overflow */
.fit-content {
  width: fit-content !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Optional: Shrinks the box AND centers it in the middle of <main> */
.fit-content-center {
  width: fit-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}



/* ========================================================= */
/* == 13. FOOTER STYLING                                  == */
/* ========================================================= */
footer {
  text-align: center;
  margin-top: 50px;
  padding: 20px;
  font-size: 0.9em;
  color: var(--text-muted);
}

.footer-utility-button {
  display: inline-block;
  padding: 5px 10px;
  font-size: 0.85em;
  width: auto;
  box-sizing: border-box;
  border-radius: 6px;
  font-weight: 300;
  text-decoration: none;
  text-align: center;
  background-color: var(--bg-surface-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  transition: all 0.2s ease-out;
}

.footer-utility-button:hover,
.footer-utility-button:active {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(182, 182, 182, 0.7);
}


/* ========================================================= */
/* == COMIC VIEWER MODAL STYLES                           == */
/* ========================================================= */
#comic-viewer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.comic-image-wrapper {
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.comic-image-wrapper img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.comic-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  color: #000000;
  border: 1px solid #cccccc;
  font-size: 2rem;
  padding: 12px 18px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 10001;
}

.comic-prev-btn { left: 20px; }
.comic-next-btn { right: 20px; }

.comic-page-counter {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #000000;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 400;
  border: 1px solid #cccccc;
}

.comic-close-btn {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #ffffff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10001;
}

.comic-close-btn:hover {
  color: var(--accent-pink);
}



/* ========================================================= */
/* == 14. SMILEY MODAL & LESSON PLANNER POPUP             == */
/* ========================================================= */

/* Make the Smiley Icon Clickable */
.pagemap-link.active::before {
  cursor: pointer;
  pointer-events: auto;
}

/* Modal Overlay Backdrop */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

/* The Modal Container Box */
.modal-content-box {
  background-color: var(--bg-surface-1);
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
}

/* Modal Close Button (X) */
.modal-close-btn {
  position: absolute;
  top: 10px; 
  right: 15px;
  background: none; 
  border: none;
  color: var(--text-muted); 
  font-size: 28px;
  cursor: pointer; 
  transition: color 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--accent-pink);
}

/* Toggle Switch Controls */
.fsp-toggle-wrapper {
  display: flex; 
  justify-content: center; 
  align-items: center; 
  gap: 15px;
  margin-top: 25px;
}

.toggle-text { 
  color: var(--text-muted); 
  font-weight: 300; 
  transition: color 0.15s ease; 
}

.toggle-text.active-text { 
  color: var(--text-primary); 
}

.switch { 
  position: relative; 
  display: inline-block; 
  width: 50px; 
  height: 26px; 
}

.switch input { 
  opacity: 0; 
  width: 0; 
  height: 0; 
}

.slider { 
  position: absolute; 
  cursor: pointer; 
  top: 0; left: 0; right: 0; bottom: 0; 
  background-color: var(--bg-body); 
  border: 1px solid var(--border-subtle); 
  border-radius: 34px; 
  transition: .4s; 
}

.slider:before { 
  position: absolute; 
  content: ""; 
  height: 18px; 
  width: 18px; 
  left: 3px; 
  bottom: 3px; 
  border-radius: 50%; 
  transition: .4s; 
  background-color: transparent; 
  border: 2px solid var(--accent-green); 
  box-sizing: border-box; 
}

input:checked + .slider:before { 
  transform: translateX(24px); 
  background-color: var(--accent-green); 
  border: 2px solid var(--accent-green); 
}

/* Grey Action Button inside Modal */
.grey-glow-btn {
  display: block;
  width: 100%;
  padding: 10px 15px;
  box-sizing: border-box;
  border-radius: 6px;
  font-weight: 300;
  color: #ffffff;
  text-decoration: none;
  text-align: center;
  border: none;
  background-color: var(--bg-surface-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  outline: none;
}

.grey-glow-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(150, 150, 150, 0.4); 
}

/* Modal Form Controls */
.checkbox-row { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  cursor: pointer; 
  color: var(--text-primary); 
  font-weight: 300; 
}

.input-label { 
  display: block; 
  color: var(--text-muted); 
  font-size: 0.85em; 
  margin-bottom: 5px; 
}

.form-input { 
  width: 100%; 
  box-sizing: border-box; 
  background-color: var(--bg-surface-2); 
  border: 1px solid var(--border-subtle); 
  color: var(--text-primary); 
  padding: 10px; 
  border-radius: 6px; 
  font-family: 'Noto Sans', sans-serif; 
  outline: none; 
  color-scheme: dark; 
}

.form-input:focus { 
  border-color: var(--accent-green); 
}

.disabled-form-section {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.form-input:disabled {
  background-color: var(--bg-body);
  color: var(--text-muted);
  border-color: var(--border-subtle);
  cursor: not-allowed;
}




/* ========================================================= */
/* == 15. MOBILE RESPONSIVE LAYOUT (<= 600px)             == */
/* ========================================================= */

@media (max-width: 600px) {
  /* 1. Main & Container Padding */
  main {
    padding: 20px 15px;
  }

  /* 2. Header & Title Squishing/Stacking */
  .header-centered {
    flex-direction: column !important;
    gap: 15px !important;
    padding: 20px 0 5px 0 !important;
  }

  h1 {
    font-size: 1.6rem !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.2;
  }

  /* 3. TOC Container & Button Formatting */
  .layout-clean .toc {
    padding-top: 10px !important;
    margin-top: 0 !important;
  }

  .layout-clean .toc ul {
    gap: 4px !important;
  }

  .toc-clean .standard-button,
  .toc-item-wrapper {
    width: 100% !important;
    max-width: 340px !important;
    margin: 0 auto !important;
  }

  .toc-clean .standard-button {
    line-height: 1.15 !important;
    padding: 8px 15px !important;
  }

  /* 4. Action Links Sizing */
  .icon-link {
    display: flex !important;
    width: 100% !important;
    max-width: 340px !important;
    margin: 0 auto 10px auto !important;
    padding: 10px 15px !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  /* 5. Rotated Table Column 1 */
  .page-sprachkompetenz .table-rotated-col1 td:first-child {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    vertical-align: middle;
    padding: 15px 5px;
  }

  /* 6. Arztbrief Comparison Table Stack */
  .page-sprachkompetenz main .table-comparison,
  .page-sprachkompetenz main .table-comparison tbody,
  .page-sprachkompetenz main .table-comparison tr,
  .page-sprachkompetenz main .table-comparison td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-sprachkompetenz main .table-comparison tr {
    padding-bottom: 25px !important;
    margin-bottom: 25px !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }

  .page-sprachkompetenz main .table-comparison tr:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .page-sprachkompetenz main .table-comparison td {
    padding: 4px 0 !important;
  }

  .page-sprachkompetenz main .table-comparison td:first-child {
    border-right: none !important;
  }

  .page-sprachkompetenz main .table-comparison td:first-child::after {
    content: "→";
    display: block;
    text-align: left;
    color: var(--accent-blue);
    font-size: 1.4rem;
    line-height: 1;
    margin: 12px 0 8px 0;
  }

  /* 7. Mobile Comic Controls */
  .comic-image-wrapper {
    max-width: 96vw;
    max-height: 80vh;
  }

  .comic-image-wrapper img {
    max-width: 100%;
    max-height: 80vh;
  }

  .comic-nav-btn {
    top: auto !important;
    bottom: 22px !important;
    transform: none !important;
    padding: 6px 14px !important;
    font-size: 1.4rem !important;
  }

  .comic-prev-btn { left: 15px !important; }
  .comic-next-btn { right: 15px !important; }

  .comic-page-counter {
    bottom: 25px !important;
    padding: 5px 12px;
    font-size: 0.85rem;
  }

  .comic-close-btn {
    top: 10px !important;
    right: 15px !important;
    font-size: 2.2rem !important;
  }
}

@media (max-width: 600px) {
  /* Allow slashes and long concatenated terms to break cleanly */
  .content-unit li,
  main li {
    overflow-wrap: anywhere !important; /* Forces soft breaks at slashes and symbols */
  }
}


/* ========================================================= */
/* == SITEMAP TOP BUTTON CONTAINER                        == */
/* ========================================================= */
.sitemap-home-button-container {
    display: flex;
    flex-direction: column; /* Stacks items vertically */
    align-items: center;    /* Centers them horizontally */
    gap: 16px;              /* Perfect spacing between Yin-Yang and Home */
    padding-bottom: 20px;
}

/* ========================================================= */
/* == YIN-YANG THEME TOGGLE BUTTON (SVG Version)          == */
/* ========================================================= */

.theme-toggle-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.yin-yang-svg {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    /* Use a variable for rotation, default to 0deg */
    transform: rotate(var(--spin-angle, 0deg)); 
}

/* Hover effects */
.theme-toggle-btn:hover .yin-yang-svg {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    /* Keep the current rotation, but add the scale */
    transform: rotate(var(--spin-angle, 0deg)) scale(1.05); 
}






/* ========================================================= */
/* == ALWAYS-DARK ACTION BUTTONS (💬 SPEECH & 🧩 PUZZLE)  == */
/* ========================================================= */

.toc-icon-button,
.floating-gutter-btn,
.glow-speech,
.footer-utility-button,
.glow-puzzle {
  background-color: #252525 !important;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Ensure Light Mode theme overrides do not force a light background */
[data-theme="light"] .toc-icon-button,
[data-theme="light"] .floating-gutter-btn,
[data-theme="light"] .glow-speech,
[data-theme="light"] .footer-utility-button,
[data-theme="light"] .glow-puzzle {
  background-color: #252525 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Prevent light-mode .icon-link hover from washing out dark buttons */
[data-theme="light"] .icon-link.glow-speech:hover,
[data-theme="light"] .footer-utility-button:hover,
[data-theme="light"] .icon-link.glow-puzzle:hover {
  color: #ffffff;
  background-color: #252525 !important;
}


.formula-group {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
}


/* ========================================================= */
/* == ROMAN NUMERAL LISTS & BADGES (UNIFIED PINK STYLE)   == */
/* ========================================================= */

/* 1. Roman Numeral Badge inside .content-pink */
.numeral-badge {
  color: var(--accent-pink);
  font-size: 1em;       /* Normal body font size */
  font-weight: 300;     /* Matches standard text weight */
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

[data-theme="light"] .numeral-badge {
  font-weight: 390;     /* Exact optical weight boost used for light-mode pink text */
}

/* 2. Roman Numeral Ordered List (Clean, No Colons or Periods) */
ol.list-roman-pink {
  list-style-type: none;
  counter-reset: roman-counter;
  padding-left: 0;
  margin-bottom: 20px;
}

ol.list-roman-pink > li {
  counter-increment: roman-counter;
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
  line-height: 1.4;
}

ol.list-roman-pink > li::before {
  content: counter(roman-counter, upper-roman); /* Plain numeral: I, II, III */
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-pink);
  font-size: 1em;       /* Normal body font size */
  font-weight: 300;     /* Matches standard text weight */
}

[data-theme="light"] ol.list-roman-pink > li::before {
  font-weight: 390;     /* Exact optical weight boost used for light-mode pink text */
}


/* ========================================================= */
/* == 3-COLUMN IMAGE VOCAB TABLE (NO ROW BORDERS)         == */
/* ========================================================= */
table.image-vocab-table {
  width: 100%;
  table-layout: fixed; /* Guarantees three equal-width columns */
  margin: 40px 0;
  border-collapse: collapse;
}

table.image-vocab-table td {
  width: 33.33%;
  padding: 16px 12px;
  vertical-align: middle; /* Vertically centers term, image, and sentence */
  border: none; /* Removes horizontal borders between rows */
  color: var(--text-primary);
  line-height: 1.4;
}

table.image-vocab-table td.vocab-image {
  text-align: center;
}

table.image-vocab-table img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  aspect-ratio: 1 / 1; /* Ensures perfect square dimensions */
  border-radius: 6px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Mobile Responsiveness (< 600px) */
@media (max-width: 600px) {
  table.image-vocab-table,
  table.image-vocab-table tbody,
  table.image-vocab-table tr,
  table.image-vocab-table td {
    display: block;
    width: 100% !important;
    text-align: center !important;
  }

  table.image-vocab-table tr {
    padding: 16px 0;
    border: none;
  }

  table.image-vocab-table td {
    padding: 4px 0;
    border: none;
  }

  table.image-vocab-table img {
    margin: 8px auto;
  }
}


/* ========================================================= */
/* == FAUX 3D CARD TABLES                                 == */
/* ========================================================= */

.table-card {
  width: 100%;
  margin: 40px 0;
  border-collapse: separate; 
  border-spacing: 0;
  background-color: var(--bg-surface-1);
  border-radius: 6px;
  overflow: hidden; 
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .table-card {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Base Cell Styling (Horizontal lines between rows) */
.table-card th,
.table-card td {
  padding: 15px;
  text-align: left;
  vertical-align: top;
  color: var(--text-primary);
  font-weight: 300;
  border-bottom: 1px solid var(--border-subtle); 
}

/* 1. Subtle vertical divider + Vertically centered text for the first column ONLY */
.table-card th:first-child,
.table-card td:first-child {
  border-right: 1px solid var(--border-subtle); 
  vertical-align: middle; 
}

/* 2. Crucial 3D Fix: Completely remove the line from the very last row of the body */
.table-card tbody tr:last-child th,
.table-card tbody tr:last-child td {
  border-bottom: none !important; 
}

/* Modifier for multi-column tables with vertical dividers */
.table-card.table-cols-divided th:not(:last-child),
.table-card.table-cols-divided td:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
}

/* Fix for rowspan vertical line inconsistency (removes line from all numerals) */
.table-card .cell-numeral {
  border-right: none !important;
}


/* Allow thematic colors to override the sitemap's grey lock */
.persistent-sitemap .sitemap-button.color-green {
    color: var(--accent-green) !important;
}

.persistent-sitemap .sitemap-button.color-pink {
    color: var(--accent-pink) !important;
}

.persistent-sitemap .sitemap-button.color-blue {
    color: var(--accent-blue) !important;
}


/* ========================================================= */
/* == SITEMAP: COLORED HOVER GLOW & VERTICAL LINES        == */
/* ========================================================= */

/* 1. The "Light Up" Hover Effect for Colored Text */
.persistent-sitemap .sitemap-button:hover span[class*="color-"] {
    filter: brightness(1.3); /* Makes the base color 30% brighter */
    text-shadow: 0 0 10px currentColor; /* Casts a glow in its exact color */
}

/* In newstyle.css */
.sitemap-section {
    /* border-left-width: 1px; */  /* Comment this out */
    /* border-left-style: solid; */ /* Comment this out */
    padding-left: 0;       
    margin-left: 0px;      
    margin-bottom: 25px;   
}

/* Remove the gap after the final section so it doesn't push the Impressum buttons too far down */
.sitemap-section:last-child {
    margin-bottom: 0;
    border-bottom: transparent; /* Keeps your 4th section clean */
}

/* Align headers flush with the buttons */
.persistent-sitemap .sitemap-header {
    margin-top: 0 !important; 
    padding-left: 10px !important; 
}

/* 3. The Specific Line Colors */
.sitemap-section.line-green { border-color: var(--accent-green); }
.sitemap-section.line-pink  { border-color: var(--accent-pink); }
.sitemap-section.line-blue  { border-color: var(--accent-blue); }
.sitemap-section.line-white { border-color: #e0e0e0; } /* Soft white so it isn't blinding */

/* ========================================================= */
/* == SITEMAP: PERFECT VERTICAL CENTERING                 == */
/* ========================================================= */

/* Force the top and bottom containers to share space equally */
.sitemap-home-button-container,
.sitemap-impressum-container {
    flex: 1;              /* Both containers take exactly 50% of the leftover vertical space */
    display: flex;
    flex-direction: column;
}

/* Align the Home button to the very top */
.sitemap-home-button-container {
    justify-content: flex-start;
    padding-top: 35px;
    padding-bottom: 0;    /* Remove unequal bottom padding */
}

/* Align the Yin-Yang button to the very bottom */
.sitemap-impressum-container {
    justify-content: flex-end;
    padding-bottom: 35px;
    padding-top: 0;
}

.normal-style {
  font-style: normal;
}

/* 1. Remove the massive 50px margin from all nested lists */
li ul {
  margin-bottom: 0;
  margin-top: 5px; /* Adds a small, clean gap above nested bullets */
}

/* 2. Prevent the first element in a box from pushing the top padding down */
.content-unit > *:first-child {
  margin-top: 0;
}

/* 3. Prevent the last element in a box from pushing the bottom padding out */
.content-unit > *:last-child {
  margin-bottom: 0;
}


/* Pull annotations tightly up against table cards above them */
.table-card + .annotation,
.table-card + p.annotation {
  margin-top: -30px;
  display: block;
}


/* Zeroes out first/last child margins for any box that uses this class */
.box-flush > *:first-child {
  margin-top: 0;
}
.box-flush > *:last-child {
  margin-bottom: 0;
}

/* ========================================================= */
/* == KEYSTONE SPRECHPRAXIS LINKS (GRADIENT FADE)         == */
/* ========================================================= */

/* APG Sprechpraxis */
.persistent-sitemap .sitemap-button[data-page="apg-praxis"] {
    /* Fades out completely by 65% of the button width */
    background-image: linear-gradient(to right, rgba(67, 189, 136, 0.15) 0%, rgba(67, 189, 136, 0.1) 40%, transparent 65%);
    border-radius: 4px 0 0 4px;
    transition: all 0.25s ease-in-out;
}

.persistent-sitemap .sitemap-button[data-page="apg-praxis"]:hover {
    /* Pushes the color slightly further out to 80% on hover */
    background-image: linear-gradient(to right, rgba(67, 189, 136, 0.35) 0%, rgba(67, 189, 136, 0.15) 55%, transparent 80%);
    transform: translateX(1px);
}

/* AAG Sprechpraxis */
.persistent-sitemap .sitemap-button[data-page="aag-praxis"] {
    background-image: linear-gradient(to right, rgba(46, 149, 211, 0.15) 0%, rgba(46, 149, 211, 0.1) 40%, transparent 65%);
    border-radius: 4px 0 0 4px;
    transition: all 0.25s ease-in-out;
}

.persistent-sitemap .sitemap-button[data-page="aag-praxis"]:hover {
    background-image: linear-gradient(to right, rgba(46, 149, 211, 0.35) 0%, rgba(46, 149, 211, 0.15) 55%, transparent 80%);
    transform: translateX(1px);
}


/* Independent Arrow Movement */
.hover-arrow {
    display: inline-block; 
    transition: transform 0.25s ease-in-out;
}

.persistent-sitemap .sitemap-button[data-page]:hover .hover-arrow {
    transform: translateX(1px); /* Slides the arrow out an extra 2px */
}


/* ========================================================= */
/* == HERO DUAL IMAGE CONTAINER & FAUX 3D TILTS           == */
/* ========================================================= */
.hero-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
  max-width: 680px;
  margin: 50px auto 40px auto;
  padding: 0 20px;
}

.hero-image-box {
  flex: 0 1 290px; /* Reduced size by 30% */
  max-width: 290px;
  transition: transform 0.3s ease;
}

.hero-image-box img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* Specific Rotations & Organic Offset */
.hero-image-box.tilt-left {
  transform: translateY(-30px) rotate(6deg); /* Lifted up 15px & tilted 8° CW */
}

.hero-image-box.tilt-right {
  transform: rotate(-4deg); /* Tilted 4° CCW */
}

/* Light Mode: White Faux 3D Boxes */
[data-theme="light"] .hero-image-box {
  background-color: #ffffff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Dark Mode: Direct on background */
[data-theme="dark"] .hero-image-box {
  background-color: transparent;
  padding: 0;
  box-shadow: none;
}

/* Mobile Adaptability */
@media (max-width: 600px) {
  .hero-image-container {
    flex-direction: column;
    gap: 32px;
  }
  .hero-image-box {
    max-width: 240px;
  }
  .hero-image-box.tilt-left {
    transform: translateY(0) rotate(8deg); /* Clears Y-offset when vertically stacked */
  }
}




/* ========================================================= */
/* == NODE TREE SCHEMATIC (Leitfaden Arztbrief)           == */
/* ========================================================= */

.schematic-wrapper {
    width: 100%;
    overflow-x: auto; /* Allows schematic to scroll neatly on mobile */
    padding: 20px 0;
    margin: 40px 0;
}

.schematic-grid {
    display: grid;
    /* 9 Columns: Words, Brackets, Words, Brackets... */
    grid-template-columns: min-content 30px min-content 30px max-content 30px min-content 30px min-content;
    
    /* Row 1 (Top 10), Row 2 (Spacer), Row 3 (Mid 5), Row 4 (Bottom 5) */
    grid-template-rows: auto 30px auto auto;
    
    column-gap: 12px;
    align-items: stretch;
    width: fit-content;
    margin: 0 auto; /* Centers the whole block */
    color: var(--text-primary);
    font-size: 0.95em;
}

/* Grid Cells & Flex Centering */
.sch-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* List Clustering (Vertical Spacing for the 20 words) */
.sch-list {
    gap: 6px;
}
.sch-list > span {
    white-space: nowrap;
    line-height: 1.2;
}

/* Structural Row Definitions */
.sch-row-1 { grid-row: 1 / 2; }
.sch-row-3 { grid-row: 3 / 4; }
.sch-row-4 { grid-row: 4 / 5; }
.sch-row-3-to-4 { grid-row: 3 / 5; } /* Spans the bottom 10 words */
.sch-row-full { grid-row: 1 / 5; }   /* Spans the entire schematic height */

/* Structural Column Definitions */
.sch-col-1 { grid-column: 1; align-items: flex-end; padding-right: 5px; }
.sch-col-2 { grid-column: 2; } 
.sch-col-3 { grid-column: 3; align-items: center; } 
.sch-col-4 { grid-column: 4; } 
.sch-col-5 { grid-column: 5; } 
.sch-col-6 { grid-column: 6; } 
.sch-col-7 { grid-column: 7; align-items: center; } 
.sch-col-8 { grid-column: 8; } 
.sch-col-9 { grid-column: 9; padding-left: 5px; }

/* SVG Brackets */
.svg-bracket {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.svg-bracket path {
    fill: none;
    stroke: var(--text-muted); /* Grey default */
    stroke-width: 1.5px;
    vector-effect: non-scaling-stroke; /* Crucial: Keeps 1.5px stroke even when stretched vertically */
    stroke-linecap: round;
}

/* Theme integration for Green components */
.svg-bracket.bracket-green path {
    stroke: var(--accent-green);
    stroke-width: 2px;
}

.sch-bold-green {
    color: var(--accent-green);
    font-weight: 400; /* Sturdy enough to punch through light mode */
    white-space: nowrap;
}

[data-theme="light"] .sch-bold-green {
    font-weight: 450; /* Optical boost for light backgrounds */
}



/* Subtle Background Highlighting */
.sch-highlight-bg {
    /* Starts at grid line 3 (Col 3), ends at grid line 8 (after Col 7) */
    grid-column: 3 / 8; 
    grid-row: 1 / 5; /* Spans the full height of the 4 grid rows */
    
    background-color: var(--accent-green);
    opacity: 0.08; /* Extremely subtle so text remains highly readable */
    border-radius: 8px; /* Softens the corners */
    
    /* Pulls the background slightly outward so the text isn't cramped against the edge */
    margin: -10px -5px; 
}

/* Slightly boost opacity in dark mode if it feels too faint */
[data-theme="dark"] .sch-highlight-bg {
    opacity: 0.12; 
}

/* ========================================================= */
/* == PAGE: AUFKLÄRUNGEN (M3 UNIFIED ACCORDION CARDS)     == */
/* ========================================================= */

/* 1. Desktop Centering & Sitemap Clearance (~40px gap) */
@media (min-width: 1300px) {
  body.page-aufklaerungen {
    padding-right: 0 !important;
  }

  .page-aufklaerungen main {
    max-width: 900px;
  }
}

.page-aufklaerungen .accordion {
  margin: 40px 0;
}


/* 2. The Unified Card Container (M3 Surface) */
.page-aufklaerungen .accordion-item {
  position: relative;
  margin-bottom: 16px;
  border-radius: 8px; 
  background-color: var(--bg-surface-2); 
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); 
  transition: box-shadow 0.2s ease;
  /* overflow: hidden; REMOVED to allow Modul labels to hang outside */
}

[data-theme="dark"] .page-aufklaerungen .accordion-item {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Outer Card Glow on Hover */
.page-aufklaerungen .accordion-item:hover {
  box-shadow: 0 4px 14px var(--accent-green-glow);
}

/* Override Outer Glow for Modul II (Pink) */
.page-aufklaerungen .accordion-item:has(.accordion-header-with-tabs):hover {
  box-shadow: 0 4px 14px var(--accent-pink-glow);
}

/* ... (Keep your .module-label rules exactly as they are) ... */

/* 4. Flat Accordion Headers */
.page-aufklaerungen .accordion-header {
  width: 100%;
  padding: 14px 20px;
  box-sizing: border-box;
  font-family: 'Noto Sans', sans-serif;
  font-weight: 300;
  color: var(--text-primary);
  text-align: center;
  
  border: none;
  background-color: transparent; 
  
  /* Added to keep hover states rounded since we removed overflow:hidden from the parent */
  border-radius: 8px; 
  
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  outline: none;
}

/* 3. Modul Labels */
.page-aufklaerungen .module-label {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 25px;
  white-space: nowrap;
  font-weight: 300;
  font-size: 0.95rem;
}

@media (max-width: 1299px) {
  .page-aufklaerungen .module-label {
    position: static;
    transform: none;
    display: block;
    margin-bottom: 6px;
    text-align: center;
  }
}



/* M3 State Layer (Subtle darkening on hover) */
.page-aufklaerungen .accordion-header:hover,
.page-aufklaerungen .accordion-header:active,
.page-aufklaerungen .accordion-header.active {
  color: var(--accent-green);
  background-color: var(--bg-surface-3); 
}

/* 5. Modul II: Header with Vertical Sub-Tabs */
.page-aufklaerungen .accordion-header-with-tabs {
  height: 160px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  position: relative;
}

.page-aufklaerungen .accordion-header-with-tabs:hover,
.page-aufklaerungen .accordion-header-with-tabs:active {
  color: var(--text-primary);
  background-color: var(--bg-surface-3);
}

.page-aufklaerungen .accordion-header-with-tabs .sub-accordion-tabs {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 150px;
}

.page-aufklaerungen .accordion-header-with-tabs .sub-accordion-tabs span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--text-primary);
  font-size: 14px;
  margin: 0 3px;
  cursor: pointer;
  transition: color 0.2s ease-in-out;
  flex-shrink: 0;
}

.page-aufklaerungen .accordion-header-with-tabs .sub-accordion-tabs span:hover,
.page-aufklaerungen .accordion-header-with-tabs .sub-accordion-tabs span.active {
  color: var(--accent-pink);
}

.page-aufklaerungen .accordion-header-with-tabs:hover span:not(:hover) {
  color: var(--text-primary);
}

/* 6. The Expanded Content & Hairline Divider */
.page-aufklaerungen .accordion-content {
  background-color: transparent; /* Shares the card's surface color */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.page-aufklaerungen .accordion-content.open {
  padding: 20px;
  border-top: 1px solid var(--border-subtle); /* M3 Hairline Divider */
}

/* Inner Tab Visibility */
.sub-accordion-content-area .sub-content {
  display: none;
}

.sub-accordion-content-area .sub-content.active {
  display: block;
}

/* 7. Vocabulary Lists Inside Drawers */
.vocab-list-examples {
  margin: 10px 0;
  padding-left: 20px;
}

.vocab-list-examples dt {
  font-weight: 300;
  color: var(--accent-blue);
  margin-bottom: 0;
  padding-left: 25px;
  position: relative;
}

.vocab-list-examples dt::before {
  content: '•';
  color: var(--accent-blue);
  font-size: 2em;
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
}

.vocab-list-examples dd {
  margin-left: 30px;
  margin-bottom: 8px;
  padding-left: 5px;
  font-weight: 300;
  display: list-item;
  list-style-type: circle;
}

.vocab-list-examples dd::marker {
  color: var(--text-primary);
}


/* ========================================================= */
/* == PLAY BUTTON & VIDEO PLAYER (THEME-AWARE)             == */
/* ========================================================= */

.play-button-wrapper {
  width: 77px;
  height: 77px;
  margin: 40px auto 100px auto;
  background-color: var(--bg-surface-1);
  
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease-out;
}

[data-theme="dark"] .play-button-wrapper {
  background-color: var(--bg-surface-2);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.play-pause-icon-container {
  display: flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.15s ease-out;
}

.play-icon-triangle {
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 22px solid var(--accent-green);
  transition: border-left-color 0.15s ease-out;
}

.play-icon-bar {
  width: 5px;
  height: 26px;
  background-color: var(--accent-green);
  border-radius: 1px;
  transition: background-color 0.15s ease-out;
}

/* Hover & Active States */
.play-button-wrapper:hover,
.play-button-wrapper:active {
  transform: translateY(-2px);
  box-shadow: 0 0 14px var(--accent-green-glow);
}

.play-button-wrapper:hover .play-pause-icon-container,
.play-button-wrapper:active .play-pause-icon-container {
  transform: scale(0.95);
}

/* Video Overlay & Frame */
.video-player-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  max-width: 900px;
  margin: 40px auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.close-video-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.close-video-btn:hover {
  transform: scale(1.15);
  color: var(--accent-pink);
}

/* ========================================================= */
/* == PLAY BUTTON SPACING & VERTICAL CENTERING             == */
/* ========================================================= */

/* 1. Symmetrical 65px margins around the play button */
.page-aufklaerungen .play-button-wrapper {
  margin: 65px auto 65px auto;
}

/* 2. Zero out top padding/margin on main & accordion for exact vertical centering */
.page-aufklaerungen main {
  padding-top: 0;
}

.page-aufklaerungen .accordion {
  margin-top: 0;
}



/* ========================================================= */
/* == WORTSCHATZ TABLE: SEPARATORS & ALIGNMENT            == */
/* ========================================================= */

/* Clearer section separators directly on the row */
table.table-wortschatz-clean > tbody > tr {
    border-bottom: 1.5px solid var(--accent-blue);
}

/* Sub-category separator (Subtle Grey) */
table.table-wortschatz-clean > tbody > tr.sub-category-row {
    border-bottom: 1px solid var(--border-subtle);
}

/* Remove line from the last row */
table.table-wortschatz-clean > tbody > tr:last-child {
    border-bottom: none;
}

/* Strict Top Alignment */
table.table-wortschatz-clean td {
    vertical-align: top; /* Pushes content to the top border */
    padding-top: 25px;   /* Consistent top clearance */
    padding-bottom: 25px;
}

/* Category Header (Left Column) */
table.table-wortschatz-clean td:first-child {
    padding-right: 20px;
    font-weight: 400;
    line-height: 1.3;
    /* Optical tweak to ensure first line sits flush */
    margin-top: 0; 
}

/* ========================================================= */
/* == WORTSCHATZ BUTTONS & REFERENCES (NEW CLASSES)       == */
/* ========================================================= */

/* Action Panel: Stacks Buttons and Reference Badge on the right */
.ws-action-panel {
    float: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-left: 30px;
    margin-bottom: 15px;
    /* Pulls panel up to align perfectly with the first line of text */
    margin-top: -2px; 
}

/* Grouping the Buttons + Arrow */
.ws-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-btn-group::before {
    content: "→";
    color: var(--accent-blue);
    font-size: 1.2rem;
    margin-right: 4px;
    line-height: 1;
}

/* New Uniform Button Styling */
.ws-btn {
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

/* Light Mode Button Optic Adjustments */
[data-theme="light"] .ws-btn {
    background-color: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Unified Blue Hover State */
.ws-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-blue-glow);
    border-color: var(--accent-blue);
    background-color: #ffffff;
}

/* Reference Badge (e.g. 📝 B4, B5) */
.ws-ref-badge {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 390; 
    background-color: var(--bg-surface-3);
    padding: 4px 12px;
    border-radius: 12px; /* Neat pill shape */
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Mobile Overrides (< 600px) */
@media (max-width: 600px) {
    .ws-action-panel {
        float: none;
        align-items: flex-start;
        margin-left: 0;
        margin-top: 15px;
        margin-bottom: 20px;
        flex-direction: row; 
        flex-wrap: wrap;
        align-items: center;
    }
    
    .ws-btn-group::before {
        display: none; /* Hide the arrow on mobile to save space */
    }
}


/* ========================================================= */
/* == WORTSCHATZ TABLE: SEPARATORS & ALIGNMENT            == */
/* ========================================================= */

/* Clearer section separators directly on the row */
table.table-wortschatz-clean > tbody > tr {
    border-bottom: 1.5px solid var(--accent-blue);
}

/* Sub-category separator (Subtle Grey) */
table.table-wortschatz-clean > tbody > tr.sub-category-row {
    border-bottom: 1px solid var(--border-subtle);
}

/* Remove line from the last row */
table.table-wortschatz-clean > tbody > tr:last-child {
    border-bottom: none;
}

/* Strict Top Alignment */
table.table-wortschatz-clean td {
    vertical-align: top; /* Pushes content to the top border */
    padding-top: 25px;   /* Consistent top clearance */
    padding-bottom: 25px;
}

/* Category Header (Left Column) */
table.table-wortschatz-clean td:first-child {
    padding-right: 20px;
    font-weight: 400;
    line-height: 1.3;
    /* Optical tweak to ensure first line sits flush */
    margin-top: 0; 
}

/* ========================================================= */
/* == WORTSCHATZ BUTTONS & REFERENCES (NEW CLASSES)       == */
/* ========================================================= */

/* Action Panel: Stacks Buttons and Reference Badge on the right */
.ws-action-panel {
    float: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-left: 30px;
    margin-bottom: 15px;
    /* Pulls panel up to align perfectly with the first line of text */
    margin-top: -2px; 
}

/* Grouping the Buttons + Arrow */
.ws-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-btn-group::before {
    content: "→";
    color: var(--accent-blue);
    font-size: 1.2rem;
    margin-right: 4px;
    line-height: 1;
}

/* New Uniform Button Styling */
.ws-btn {
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

/* Light Mode Button Optic Adjustments */
[data-theme="light"] .ws-btn {
    background-color: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Unified Blue Hover State */
.ws-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-blue-glow);
    border-color: var(--accent-blue);
    background-color: #ffffff;
}

/* Reference Badge (e.g. 📝 B4, B5) */
.ws-ref-badge {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 390; 
    background-color: var(--bg-surface-3);
    padding: 4px 12px;
    border-radius: 12px; /* Neat pill shape */
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Mobile Overrides (< 600px) */
@media (max-width: 600px) {
    .ws-action-panel {
        float: none;
        align-items: flex-start;
        margin-left: 0;
        margin-top: 15px;
        margin-bottom: 20px;
        flex-direction: row; 
        flex-wrap: wrap;
        align-items: center;
    }
    
    .ws-btn-group::before {
        display: none; /* Hide the arrow on mobile to save space */
    }
}



/* Primary List: Full Discs */
ul {
  list-style-type: disc;
  padding-left: 30px;
  margin-bottom: 50px;
}

/* Secondary (Nested) List: Empty Circles */
ul ul {
  list-style-type: circle;
  margin-top: 5px;  /* Keeps the spacing clean beneath the parent item */
  margin-bottom: 0; /* Prevents excessive bottom margins inside nested items */
}

/* Tertiary (Deeply Nested) List: Squares (Optional, but good practice) */
ul ul ul {
  list-style-type: square;
}






/* ========================================================= */
/* == FIXED YIN-YANG BUTTON (BOTTOM LEFT)                 == */
/* ========================================================= */
.fixed-bottom-left {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 10050; /* Increased slightly to ensure it stays above the Übung modal */
    background-color: transparent !important; /* Removes the background circle */
    border: none !important; /* Removes the outline */
    box-shadow: none !important; /* Removes the wrapper's shadow, relying solely on the SVG's shadow */
    padding: 8px; /* Kept for a comfortably large click area */
    border-radius: 50%;
}

/* Adjust position slightly for mobile to prevent thumb clashes */
@media (max-width: 600px) {
    .fixed-bottom-left {
        bottom: 20px;
        left: 15px;
    }
}


/* ========================================================= */
/* == HOMEPAGE TRANSPARENT CONTAINER OVERRIDE             == */
/* ========================================================= */
.page-home main {
  background-color: transparent !important;
  box-shadow: none !important;
  padding-top: 0;
}


/* ========================================================= */
/* == STEALTH TEXT ("DEINER BILDUNG")                     == */
/* ========================================================= */
.stealth-text {
    font-family: 'Noto Serif', serif;
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-align: center;
    user-select: none;
    cursor: default;
    
    /* Pulls text upward into the top bar's drop shadow */
    margin-top: -15px;
    margin-bottom: 25px;
    
    /* Dark Mode: Barely visible dark grey on #121212 background */
    color: #1e1e1e;
    transition: color 0.3s ease;
}

/* Light Mode: Barely visible white on #f4f5f7 background */
[data-theme="light"] .stealth-text {
    color: #ffffff;
}



/* ========================================================= */
/* == HOMEPAGE KEYSTONE SPRECHTRAINING ACCENTS             == */
/* ========================================================= */

.button-column .keystone-button {
    margin-top: 6px; /* Extra breathing room from standard items */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Green Keystone (APG) */
.button-column .keystone-button.color-green {
    background-image: linear-gradient(90deg, rgba(67, 189, 136, 0.05) 0%, rgba(67, 189, 136, 0.16) 50%, rgba(67, 189, 136, 0.05) 100%) !important;
    border: 0px solid rgba(67, 189, 136, 0.25) !important;
}

/* Blue Keystone (AAG) */
.button-column .keystone-button.color-blue {
    background-image: linear-gradient(90deg, rgba(46, 149, 211, 0.05) 0%, rgba(46, 149, 211, 0.16) 50%, rgba(46, 149, 211, 0.05) 100%) !important;
    border: 0px solid rgba(46, 149, 211, 0.25) !important;
}

/* Hover States: Ambient Brightening & Soft Glow */
.button-column .keystone-button.color-green:hover {
    color: var(--accent-green) !important;
    background-image: linear-gradient(90deg, rgba(67, 189, 136, 0.15) 0%, rgba(67, 189, 136, 0.28) 50%, rgba(67, 189, 136, 0.15) 100%) !important;
    border-color: var(--accent-green) !important;
    box-shadow: 0 0 14px var(--accent-green-glow) !important;
    transform: translateY(-2px);
}

.button-column .keystone-button.color-blue:hover {
    color: var(--accent-blue) !important;
    background-image: linear-gradient(90deg, rgba(46, 149, 211, 0.15) 0%, rgba(46, 149, 211, 0.28) 50%, rgba(46, 149, 211, 0.15) 100%) !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 14px var(--accent-blue-glow) !important;
    transform: translateY(-2px);
}

/* Arrow Slide Effect */
.button-column .keystone-button .hover-arrow {
    display: inline-block;
    transition: transform 0.25s ease-in-out;
}

.button-column .keystone-button:hover .hover-arrow {
    transform: translateX(3px);
}


/* ========================================================= */
/* == DUAL HOVER ARROWS (LEFT & RIGHT SLIDE)                == */
/* ========================================================= */

/* Base transition for both arrow classes */
.hover-arrow-left,
.hover-arrow-right {
    display: inline-block;
    transition: transform 0.25s ease-in-out;
}

/* 1. Left Arrow: Slides Left (-3px) on Button Hover */
.standard-button:hover .hover-arrow-left,
.keystone-button:hover .hover-arrow-left,
.sitemap-button:hover .hover-arrow-left {
    transform: translateX(-3px);
}

/* 2. Right Arrow: Slides Right (+3px) on Button Hover */
.standard-button:hover .hover-arrow-right,
.keystone-button:hover .hover-arrow-right,
.sitemap-button:hover .hover-arrow-right {
    transform: translateX(3px);
}



/* Lernplan Keystone (Sitemap) */
.persistent-sitemap .sitemap-button[data-page="lernplan"] {
    background-image: linear-gradient(to right, rgba(160, 160, 160, 0.18) 0%, rgba(160, 160, 160, 0.08) 40%, transparent 65%);
    border-radius: 4px 0 0 4px;
    transition: all 0.25s ease-in-out;
}

.persistent-sitemap .sitemap-button[data-page="lernplan"]:hover {
    background-image: linear-gradient(to right, rgba(210, 210, 210, 0.35) 0%, rgba(160, 160, 160, 0.15) 55%, transparent 80%);
    transform: translateX(1px);
}

.persistent-sitemap .sitemap-button[data-page="lernplan"]:hover .color-grey {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(220, 220, 220, 0.6);
}

/* ========================================================= */
/* == REDEMITTEL TABLE, BULLETS & PAGEMAP OVERRIDES        == */
/* ========================================================= */

table.table-redemittel-clean {
    max-width: 900px;
    width: 100%;
    margin: 0 auto 40px auto;
    border-collapse: collapse;
    font-weight: 300;
}

table.table-redemittel-clean td {
    background-color: transparent;
    padding: 25px 15px;
    vertical-align: top;
    border: none;
    border-bottom: 1px solid var(--accent-green);
    color: var(--text-primary);
}

table.table-redemittel-clean tr:first-child td {
    border-top: 1px solid var(--accent-green);
}

table.table-redemittel-clean tr:last-child td {
    border-bottom: none;
}

table.table-redemittel-clean td:first-child {
    width: 22%;
    white-space: nowrap;
    padding-left: 10px;
    padding-right: 20px;
    vertical-align: top;
}

table.table-redemittel-clean tr[id] {
    scroll-margin-top: 140px;
}

/* Green List Markers */
ul.list-green-bullets {
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 25px;
}

ul.list-green-bullets li {
    line-height: 1.4;
    margin-bottom: 8px;
}

ul.list-green-bullets li::marker {
    color: var(--accent-green);
}

/* Green Pagemap Active Link Indicator */
.pagemap-green .pagemap-link.active {
    color: var(--accent-green) !important;
}

/* Active indicator emoji for Sitemap */
.page-redemittel .sitemap-button[data-page="redemittel"]::before {
    display: block;
}

.page-redemittel .sitemap-button[data-page="redemittel"] {
    color: #ffffff;
}

/* Mobile Responsiveness for Redemittel Table */
@media (max-width: 600px) {
    table.table-redemittel-clean,
    table.table-redemittel-clean tbody,
    table.table-redemittel-clean tr,
    table.table-redemittel-clean td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    table.table-redemittel-clean td:first-child {
        padding-bottom: 5px !important;
        font-weight: 400;
    }

    table.table-redemittel-clean td:last-child {
        padding-top: 5px !important;
    }
}


/* Space between TOC and <main> on Redemittel page */
.page-redemittel .toc {
    margin-bottom: 300px;
}

/* Space between TOC and <main> on Redemittel page */
.page-konjunktiv-i .toc {
    margin-bottom: 250px;
}

/* Space between TOC and <main> on sprechtraining-aag page */
.page-sprechtraining-aag .toc {
    margin-bottom: 300px;
}


/* ========================================================= */
/* == COMIC PANEL GRID                                    == */
/* ========================================================= */

.comic-strip-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 35px 0;
  width: 100%;
}

.comic-panel {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-surface-2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Light mode frame */
[data-theme="light"] .comic-panel {
  border: 1px solid var(--border-subtle);
}

/* Dark mode elevation shadow */
[data-theme="dark"] .comic-panel {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.comic-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.comic-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile Responsiveness (<= 600px) */
@media (max-width: 600px) {
  .comic-strip-container {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 20px;
  }

  .comic-panel {
    max-width: 280px;
  }
}


/* ========================================================= */
/* == CCOG TABLE (OHNE ZEILENTRENNLINIEN)                 == */
/* ========================================================= */
.ccog-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}

.ccog-table td {
  padding: 10px 0;
  vertical-align: middle;
  border-bottom: none; /* Trennlinien zwischen den Tabellenzeilen entfernt */
}

/* Spalten-Regeln */
.ccog-table td.ccog-icon {
  width: 1%;
  text-align: center;
  padding-right: 6px;
}

.ccog-table td.ccog-title {
  white-space: nowrap;
  padding-left: 6px;
}

.ccog-table td.ccog-title a,
.ccog-table td.ccog-title span {
  color: var(--accent-pink);
  font-weight: 300;
  font-size: 22px;
  text-decoration: none;
}

.ccog-table td.ccog-desc {
  color: var(--text-muted);
  font-size: 0.85em;
  font-weight: 300;
  padding-left: 15px;
}

/* Mobile Responsiveness (<= 600px) */
@media (max-width: 600px) {
  .ccog-table,
  .ccog-table tbody,
  .ccog-table tr,
  .ccog-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .ccog-table td.ccog-icon {
    display: none;
  }

  .ccog-table td.ccog-title {
    padding-left: 0;
    padding-bottom: 0;
  }

  .ccog-table td.ccog-desc {
    padding-left: 0;
    padding-top: 5px;
    padding-bottom: 20px;
  }
}

/* ========================================================= */
/* == DECORATIVE ICONS (UNSELECTABLE)                     == */
/* ========================================================= */
.decorative-icon {
  user-select: none;        /* Prevents highlighting/text-selection */
  pointer-events: none;     /* Prevents accidental clicking */
  margin-right: 6px;        /* Adds clean spacing before the link */
  text-decoration: none;    /* Ensures no underlines bleed over */
}


/* ========================================================= */
/* == APG SPLIT LAYOUT (WWSZ, IBE, NURSE SCHEMAS)         == */
/* ========================================================= */
.schema-split-layout {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 3fr;
    gap: 25px;
    align-items: center;
    padding: 15px 0;
}

/* Light mode text reinforcement */
[data-theme="light"] .schema-split-layout {
    font-weight: 350;
}

@media (max-width: 600px) {
    .schema-split-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}



/* ========================================================= */
/* == RESTORED: APG SPLIT LAYOUT (WWSZ, IBE, NURSE)       == */
/* ========================================================= */

.schema-split-layout > div:last-child {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    border-left: 1px solid var(--border-subtle);
    padding-left: 15px;
}

/* Mobile Layout Override: Drops the vertical line for a bottom border */
@media (max-width: 600px) {
    .schema-split-layout > div:last-child {
        border-left: none;
        padding-left: 0;
        padding-bottom: 25px;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--border-subtle); 
    }
    
    /* Prevents a double border on the very last schema in the box */
    .content-unit > .schema-split-layout:last-of-type > div:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}


/* ========================================================= */
/* == CCOG TRAINING STRATEGIES TABLE (APG)                == */
/* ========================================================= */

/* 1. Left column (Data): BLUE text and breathing room */
.ccog-table thead ~ tbody td:first-child {
    padding-right: 25px;
    vertical-align: top;
    color: var(--accent-blue);
}

/* Left column (Header): Alignment */
.ccog-table th:first-child {
    padding-right: 25px;
    text-align: left;
}

/* 2. Right column (Header): Stays normal size and color */
.ccog-table th:nth-child(2) {
    text-align: left;
}

/* 3. Right column (Data): Small, muted font, NO vertical line */
.ccog-table thead ~ tbody td:nth-child(2) {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    padding-bottom: 10px;
    vertical-align: top;
}

/* 4. Mobile Layout: Stack the columns */
@media (max-width: 600px) {
    .ccog-table thead {
        display: none; /* Hide headers to save space on phones */
    }
    
    /* Stack rows and cells only for tables with a header */
    .ccog-table thead ~ tbody, 
    .ccog-table thead ~ tbody tr, 
    .ccog-table thead ~ tbody td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Add a horizontal line between stacked rows */
    .ccog-table thead ~ tbody tr {
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--border-subtle);
    }
    
    /* Remove the bottom line from the very last row */
    .ccog-table thead ~ tbody tr:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .ccog-table thead ~ tbody td:first-child {
        padding-right: 0;
        padding-bottom: 5px;
        font-weight: 400;
    }
    
    .ccog-table thead ~ tbody td:nth-child(2) {
        padding-left: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}


/* ========================================================= */
/* == TEXT & DIAGRAM SPLIT LAYOUT                         == */
/* ========================================================= */
.diagram-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Text on the left, Image on the right */
    align-items: center; /* Vertically centers the text relative to the image */
    gap: 40px;
    margin: 60px 0;
}

/* Matches the explanatory text from the schema boxes */
.diagram-split-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    
    
}

/* Stacks the text and image on tablet/mobile */
@media (max-width: 800px) {
    .diagram-split-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    /* Removes the vertical line on mobile to save space */
    .diagram-split-text {
        border-left: none;
        padding-left: 0;
    }
}