/* ===== Layout constants ===== */
:root {
  --header-h: 70px;
  --footer-h: 70px;
  --sticky-gap: 1.5rem;          /* top gap under header */
  --sticky-bottom-gap: 1.5rem;    /* bottom gap above footer */

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 2.75rem;

  /* Tile tokens: shared card look for menu / content / agent sidebars */
  --tile-bg: #1e293b;
  --tile-border: 1px solid #3b82f6;
  --tile-radius: 1rem;
  --tile-padding: 1.5rem;
  --tile-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

/* Reserve space for the vertical scrollbar to avoid layout shifting.
   Nur rechts (= 'stable'), nicht beidseitig - 'both-edges' verschiebt
   das <html> um 15px nach rechts und bricht damit position:fixed-
   Coordinates der Agent-Box (Asymmetrie sichtbar als groesserer rechter
   Spaltenrand zur Content-Panel). */
html {
  scrollbar-gutter: stable;
}

/* ===== Global: dark theme ===== */
body {
  background-color: #0f172a;
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  padding-top: var(--header-h);
  padding-bottom: var(--footer-h);
}
code, pre, kbd, samp { font-family: var(--font-mono); }

/* Fixed site header/footer (scoped to direct children of <body> so inline
   <header>/<footer> tags inside content templates are not affected) */
body > header,
body > footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1030;
}
body > header { top: 0; }
body > footer { bottom: 0; }

/* ===== Top navigation (PyGround style) =====
   Icons + text, subtle hover highlight, accent for the active section. */
.nav-link-pg {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.6rem;
  color: #e2e8f0;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  position: relative;
}
.nav-link-pg:hover,
.nav-link-pg:focus-visible {
  color: #ffffff;
  background-color: rgba(59, 130, 246, 0.14);
  text-decoration: none;
  transform: translateY(-1px);
}
.nav-link-pg.active {
  color: #93c5fd;
  background-color: rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 -2px 0 0 rgba(59, 130, 246, 0.8);
}
.nav-link-pg i {
  font-size: 0.95em;
  opacity: 0.9;
}
.nav-link-pg.active i {
  opacity: 1;
  color: #60a5fa;
}

/* ===== Footer ===== */
.footer-pg .footer-copyright {
  color: #94a3b8;      /* slate-400: clearly visible on bg-dark but dezenter als Links */
  margin-right: 0.4rem;
}
.footer-pg a {
  color: #cbd5e1;
  text-decoration: none;
  margin: 0 0.4rem;
  transition: color 0.15s ease;
}
.footer-pg a:hover,
.footer-pg a:focus-visible {
  color: #93c5fd;
  text-decoration: underline;
}
.footer-pg .footer-sep {
  color: rgba(203, 213, 225, 0.35);
}

/* Content wrapper: volle Browser-Breite nutzen (war frueher 1900px max).
   Padding-x minimal, damit Sidebar/Content/Agent zusammen die ganze Breite
   ausschoepfen, statt seitlich Luft stehenzulassen. */
.content-wrapper {
  max-width: none;
  margin: 0;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

/* Main row must at least fill viewport minus header/footer */
.content-row {
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
}

/* Allow inner scroll containers inside Bootstrap flex columns */
.content-row > [class^="col-"],
.content-row > [class*=" col-"] {
  min-height: 0;
}

/* Sticky sidebar: the wrapper itself sticks to the viewport and scrolls
   internally when its content gets too tall. Using max-height (not a fixed
   height) avoids the classic "sticky does nothing because the element is
   as tall as its containing block" bug. */
.layout-box {
  position: sticky;
  top: calc(var(--header-h) + var(--sticky-gap));
  /* Volle verfuegbare Hoehe nutzen — symmetrisch zur Agent-Box rechts.
     height (statt nur max-height) sorgt dafuer, dass die Sidebar die
     Viewport-Hoehe komplett ausfuellt, auch wenn der Inhalt kuerzer ist. */
  height: calc(
    100vh - var(--header-h) - var(--footer-h) - var(--sticky-gap) - var(--sticky-bottom-gap)
  );
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  align-self: start;   /* avoid flex stretch inside Bootstrap .row */
  z-index: 1019;       /* below navbar(1030), above backgrounds */
  /* Flex-Layout, damit die innere .sidebar-box den vollen Container
     ausfuellt (sonst nur Hoehe des Inhalts, Border endet zu frueh). */
  display: flex;
  flex-direction: column;
}
.layout-box > .layout-scroll {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.layout-box > .layout-scroll > .sidebar-box {
  flex: 1 1 auto;
  min-height: 0;
}

/* Agent sidebar: fully fixed to the viewport so it never scrolls away
   regardless of parent column height, page length or nested overflow.
   Left + width are synced to the underlying .agent-col rect via JS
   (see base.html inline script). We set an explicit height rather than
   relying on top+bottom inset sizing because the flex children inside
   the chat widget otherwise inflate the element to their content size. */
.layout-box.agent-fixed {
  position: fixed;
  top: calc(var(--header-h) + var(--sticky-gap));
  height: calc(
    100vh - var(--header-h) - var(--footer-h) - var(--sticky-gap) - var(--sticky-bottom-gap)
  );
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1019;
  /* left and width are set inline by agent-pin.js */
}

/* When the agent sidebar is pinned as a fixed panel, the nested
   .sidebar-box must fill the pinned box instead of growing with its
   content (otherwise chat history would push past the viewport). */
.layout-box.agent-fixed > .layout-scroll,
.layout-box.agent-fixed > .layout-scroll > .sidebar-box {
  height: 100%;
  min-height: 0;
}

/* Legacy inner wrapper: layout-box is now the scroll container. Keep this
   neutral so existing markup in base.html still renders. */
.layout-scroll {
  height: auto;
  overflow: visible;
}

/* Sidebar box just fills the scrolling wrapper */
.layout-scroll > .sidebar-box,
.layout-box > .sidebar-box {
  min-height: 100%;
}

/* ===== Cards, images, tags ===== */
.blog-card {
  border: 1px solid rgba(0, 153, 255, 0.2);
  border-radius: 1rem;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
  background-color: #1e293b;
}
.blog-card:hover {
  box-shadow: 0 0 12px rgba(0, 153, 255, 0.6);
  border-color: rgba(0, 153, 255, 0.6);
}

/* Inside the content-panel tile, blog-cards drop their own frame so
   the two layers don't fight visually. A soft divider between rows. */
.content-panel .blog-list { display: flex; flex-direction: column; gap: 0.85rem; }
.content-panel .blog-card {
  background-color: transparent;
  border: 1px solid transparent;
  border-bottom: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 0;
  padding: 0.85rem 0 !important;
  margin: 0 !important;
}
.content-panel .blog-list .blog-card:last-child {
  border-bottom: 0;
}
.content-panel .blog-card:hover {
  background-color: rgba(59, 130, 246, 0.06);
  border-color: transparent;
  border-bottom-color: rgba(59, 130, 246, 0.35);
  box-shadow: none;
}

.blog-image {
  border-radius: 0.5rem;
  max-height: 260px;
  object-fit: contain;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.15);
}

.blog-tags { margin-top: -0.5rem; }
.blog-tag {
  background-color: #1B2433;
  color: #3A7FEF;
  border-radius: 999px;
  padding: 0.25em 0.75em;
  font-size: 0.8rem;
  margin-right: 0.4rem;
  display: inline-block;
  white-space: nowrap;
  box-shadow: 0 0 3px rgba(37, 99, 235, 0.5);
  /* Als <a> klickbar: kein Unterstrich, ueber dem stretched-link. */
  text-decoration: none;
  position: relative;
  z-index: 2;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.blog-tag:hover {
  background-color: #3A7FEF;
  color: #ffffff;
  text-decoration: none;
}

/* ===== Typography & links ===== */
h1, h4 { font-weight: 700; }
h4 { font-weight: 600; }

a {
  color: #38bdf8;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Logo gradient text */
.logo {
  font-size: 2.8rem;
  font-weight: 800;
  color: #3b82f6;
  text-decoration: none;
  background: linear-gradient(45deg, #3b82f6, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar boxes */
.bg-light {
  background-color: #1e293b !important;
  color: #e2e8f0;
}

.rounded { border-radius: 0.75rem !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important; }

/* ===== Unified tile look: same card shell for menu / content / agent ===== */
.sidebar-box,
.content-panel {
  background-color: var(--tile-bg);
  border: var(--tile-border);
  border-radius: var(--tile-radius);
  padding: var(--tile-padding);
  color: #e2e8f0;
  box-shadow: var(--tile-shadow);
  /* Let all three tiles fill the visible viewport area between header
     and footer so they line up even with few items inside. */
  min-height: calc(
    100vh - var(--header-h) - var(--footer-h)
          - var(--sticky-gap) - var(--sticky-bottom-gap)
  );
}

.sidebar-box h5 {
  font-weight: 600;
  color: #3b82f6;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-box a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  margin: 0.25rem 0;
  transition: color 0.2s;
}
.sidebar-box a:hover { color: #ffffff; }
.sidebar-box .emoji { font-size: 1rem; }

/* ===== Left section menu (pg-nav) ===== */
.pg-nav-heading {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #60a5fa;
  /* margin-left auf 0.55rem, damit das Heading optisch buendig
     mit dem linken Padding der nachfolgenden .pg-nav a-Items steht. */
  margin: 0 0 0.6rem 0.55rem;
}

/* Blog-Sidebar: Tag-Wolke + Alle-Artikel-CTA */
.pg-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.55rem;
  margin-bottom: 0.8rem;
}
.pg-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background-color: rgba(59, 130, 246, 0.12);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pg-tag:hover {
  background-color: rgba(59, 130, 246, 0.25);
  color: #ffffff;
}
.pg-tag-count {
  font-size: 0.75rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.pg-tag:hover .pg-tag-count { color: #cbd5e1; }

.pg-nav-cta {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.pg-nav-cta:hover {
  color: #ffffff;
  text-decoration: underline;
}
.pg-nav,
.pg-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pg-nav li { margin: 0.1rem 0; }
.pg-nav ul {
  padding-left: 0.9rem;
  margin-left: 0.35rem;
  border-left: 1px solid rgba(59, 130, 246, 0.2);
}
.pg-nav a,
.pg-nav .pg-nav-plain {
  display: block;
  font-size: 1rem;
  padding: 0.3rem 0.55rem;
  border-radius: 0.4rem;
  color: #cbd5e1;
  font-size: var(--text-sm);
  line-height: 1.35;
  text-decoration: none;
  margin: 0 !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pg-nav .pg-nav-plain {
  color: #94a3b8;
  font-style: italic;
}
.pg-nav a:hover {
  background-color: rgba(59, 130, 246, 0.12);
  color: #ffffff;
}
.pg-nav a.active {
  background-color: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  font-weight: 500;
}
.pg-nav-date {
  float: right;
  color: #64748b;
  font-size: 0.7rem;
  margin-left: 0.4rem;
  margin-top: 0.12rem;
}

/* Course-Sidebar: Module gruppiert, Lessons nummeriert. */
.pg-nav-heading-link {
  color: inherit;
  text-decoration: none;
}
.pg-nav-heading-link:hover {
  text-decoration: underline;
}
.course-menu .course-module + .course-module {
  margin-top: 0.15rem;
}
/* <summary> als klickbarer Modul-Header. */
.course-module-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  cursor: pointer;
  list-style: none;       /* Default-Marker weg */
  user-select: none;
}
.course-module-title::-webkit-details-marker { display: none; }
.course-module-title:hover {
  background-color: rgba(59, 130, 246, 0.10);
  color: #ffffff;
}
.course-module-title::before {
  content: "▸";
  display: inline-block;
  width: 0.9em;
  color: #64748b;
  transition: transform 0.15s ease;
}
details[open] > .course-module-title::before {
  transform: rotate(90deg);
}
.course-module-num {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  min-width: 1.9em;
}
.course-module-name {
  flex: 1 1 auto;
}
details[open] > .course-module-title {
  color: #60a5fa;
}
/* Die Lessons unter einem offenen Modul: kompakter als pg-nav-default. */
.course-module > .pg-nav {
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
}
.course-module > .pg-nav a {
  padding: 0.2rem 0.55rem 0.2rem 1.8rem;
  font-size: 0.9rem;
}
.course-lesson-num {
  display: inline-block;
  min-width: 2.2em;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  margin-right: 0.35rem;
}
.pg-nav a.active .course-lesson-num {
  color: #93c5fd;
}

/* ===== News list ===== */
.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
.news-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background-color: rgba(59, 130, 246, 0.12);
  color: #cbd5e1;
  font-size: var(--text-sm);
  text-decoration: none;
  border: 1px solid rgba(59, 130, 246, 0.25);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.news-tag-chip:hover {
  background-color: rgba(59, 130, 246, 0.25);
  color: #ffffff;
  text-decoration: none;
}
.news-tag-chip.active {
  background-color: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}
.news-tag-chip-sm {
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.news-item {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}
.news-list .news-item:last-child { border-bottom: 0; }
.news-item-compact { padding: 0.55rem 0; }
.news-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 0.2rem;
  align-items: center;
}
.news-score {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  padding: 0.05rem 0.45rem;
  border-radius: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
}
.news-source {
  font-weight: 500;
  color: #cbd5e1;
}
.news-title {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  color: #e2e8f0;
  text-decoration: none;
  line-height: 1.3;
  margin: 0.1rem 0 0.15rem;
}
.news-title:hover { color: #93c5fd; text-decoration: none; }
.news-teaser {
  margin: 0;
  color: #94a3b8;
  font-size: var(--text-sm);
  line-height: 1.45;
}

/* News detail page */
.news-back-link { color: #94a3b8; text-decoration: none; }
.news-back-link:hover { color: #93c5fd; text-decoration: none; }
.news-title-en-detail {
  color: #64748b;
  font-size: var(--text-sm);
  margin-top: 0.15rem;
  margin-bottom: 0.2rem;
}
.news-detail-summary {
  font-size: var(--text-base);
  line-height: 1.65;
  margin-bottom: 0;
}

/* Filter bar on top of news list (Alle / Meine Themen / Einstellungen) */
.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 0.6rem;
  font-size: var(--text-sm);
}
.news-filter-chip {
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.news-filter-chip:hover {
  background-color: rgba(59, 130, 246, 0.14);
  color: #ffffff;
  text-decoration: none;
}
.news-filter-chip.active {
  background-color: rgba(59, 130, 246, 0.28);
  color: #ffffff;
  font-weight: 500;
}
.news-filter-link {
  margin-left: auto;
  color: #94a3b8;
  text-decoration: none;
}
.news-filter-link:hover { color: #93c5fd; text-decoration: none; }

/* Subscribed tag marker in the tag-chip row */
.news-tag-chip.subscribed {
  border-color: rgba(16, 185, 129, 0.55);
  color: #86efac;
}

/* Month archive chip row (above the tag chips, only shown when items
   exist in more than one month). */
.news-months {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.news-month-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.04);
  color: #cbd5e1;
  font-size: 0.75rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.news-month-chip:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.45);
  color: #e2e8f0;
  text-decoration: none;
}
.news-month-chip.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* Day-Subheader inside the news list — sticks to the top while scrolling. */
.news-day-header {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0.6rem 0 0.4rem 0;
  padding: 0.35rem 0.7rem;
  background: rgba(30, 41, 59, 0.92);
  backdrop-filter: blur(4px);
  border-left: 3px solid #3b82f6;
  border-radius: 0 4px 4px 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  list-style: none;
}
.news-list { list-style: none; padding-left: 0; }

/* Pagination block at the bottom of the list. */
.news-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.news-page-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.news-page-link:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.55);
  color: #dbeafe;
  text-decoration: none;
}
.news-page-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.news-page-info {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Preferences page: tag checkbox grid */
.pref-tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.7rem 1rem;
}
.pref-tag-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 0.55rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  margin-bottom: 0;
}
.pref-tag-item:hover {
  background-color: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.45);
}
.pref-tag-item input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.pref-tag-item input[type="checkbox"]:checked + div .pref-tag-label {
  color: #93c5fd;
}
.pref-tag-label {
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.3;
}
.pref-tag-desc {
  color: #94a3b8;
  font-size: 0.82rem;
  margin-top: 0.15rem;
  line-height: 1.4;
}

/* Content body: the tile shell is provided by .content-panel, so the
   article wrapper is now just a typography container. */
.content-body {
  color: #e2e8f0;
  font-size: var(--text-base);
  line-height: 1.65;
}

/* Heading hierarchy inside article bodies */
.content-body h1,
.content-panel > header h1 {
  font-size: var(--text-3xl);
  color: #3b82f6;
  background: linear-gradient(45deg, #3b82f6, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.25);
  line-height: 1.2;
}
.content-body h2 {
  font-size: var(--text-2xl);
  color: #f1f5f9;
  font-weight: 600;
  margin-top: 2.2rem;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid #3b82f6;
  line-height: 1.3;
}
.content-body h3 {
  font-size: var(--text-xl);
  color: #f8fafc;
  font-weight: 600;
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}
.content-body h4 {
  font-size: var(--text-lg);
  color: #e2e8f0;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.content-body p,
.content-body ul,
.content-body ol { margin-bottom: 1rem; }

.content-body a { color: #58a6ff; }
.content-body a:hover {
  color: #79c0ff;
  text-decoration: underline;
}

.content-body code {
  background-color: #161b22;
  color: #ffcb6b;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
}
/* Code-in-pre: nur padding/bg/border zuruecksetzen, damit das <code>
   in einem <pre>-Codeblock nicht die erste Zeile einrueckt und keinen
   extra Hintergrund-Strip zeigt. Die orange Schriftfarbe (#ffcb6b)
   bleibt — die ist Teil des Pyground-Code-Looks. */
.content-body pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}
.content-body pre {
  background-color: #0f172a;
  color: #c9d1d9;
  font-family: var(--font-mono);
  font-size: 0.92em;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.content-body blockquote {
  border-left: 4px solid #30363d;
  background-color: #161b22;
  color: #8b949e;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  border-radius: 0.25rem;
}
.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95em;
}
.content-body th,
.content-body td {
  border: 1px solid #30363d;
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.content-body th {
  background-color: #21262d;
  color: #e2e8f0;
  font-weight: 600;
}
.content-body tr:nth-child(even) td { background-color: rgba(15, 23, 42, 0.5); }

/* ===== ACE editor wrapper ===== */
.ace-wrapper {
  margin: 2rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
}
.ace-wrapper .ace-header {
  background-color: #24303f;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ace-wrapper .language-label {
  background-color: #3b82f6;
  color: #ffffff !important;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.ace-wrapper .copy-btn i {
  font-size: 1.25rem;
  color: #ffffff; /* bright by default */
  opacity: 0.85;  /* slightly softer than pure white */
  transition: color 0.2s ease, opacity 0.2s ease;
}

.ace-wrapper .copy-btn:hover i { color: #38b2ac; }
.ace-wrapper .ace-editor {
  background-color: #212835;
  font-size: 1rem !important;
  line-height: 1.6 !important;
}
.ace_editor,
.ace_editor .ace_scroller {
  font-size: 1rem !important;
  line-height: 1.6 !important;
  padding: 1rem !important;
}


/* 1) Flex overflow fix: allow grid columns to shrink */
.content-row > [class*="col-"] { min-width: 0; }

/* 2) Center column wrapper: tile shell is shared with .sidebar-box
   (see combined rule above). Margin-top makes the tile's visible top
   edge line up with the sticky / fixed sidebars at y = 94px. */
.content-panel {
  min-width: 0;
  margin-top: var(--sticky-gap);
}

/* Bootstrap's .text-muted resolves to a very dark grey on bg-dark and
   becomes unreadable inside content/agent panels. Override to a slate
   tone that stays dezent but visible. */
.content-panel .text-muted,
.content-body .text-muted,
.sidebar-box  .text-muted,
.agent-message .text-muted {
  color: #94a3b8 !important;
}

/* 3) Safety rails for rendered markdown */
.content-body, .content-body * { box-sizing: border-box; }
.content-body img,
.content-body video,
.content-body iframe { max-width: 100%; height: auto; display: block; }
.content-body pre { overflow-x: auto; max-width: 100%; }
.content-body table { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
.content-body p, .content-body li { overflow-wrap: anywhere; }

/* 4) Space for fixed header/footer and define the CSS vars used by cookie banner */
body { padding-top: var(--header-h); padding-bottom: var(--footer-h); }

/* Dark, bright "AI hint" alert */
.alert-ai {
  background: #0b1220;
  color: #9be8ff;
  border: 1px solid rgba(0, 217, 255, 0.6);
  box-shadow:
    inset 0 0 0.6rem rgba(0, 217, 255, 0.25),
          0 0 0.6rem rgba(0, 217, 255, 0.15);
}

.alert-ai a { color: #c6f7ff; text-decoration: underline; }
.alert-ai .fa-robot { font-size: 1.1rem; color: #67e8ff; }

/* --- Sticky safety: no overflow on ancestors of the sticky element --- */
.content-wrapper,
.content-row,
.content-row > [class*="col-"] {
  overflow: visible !important;
}

/* Note: .layout-box is now the scroll container (see definition above).
   The nested .layout-scroll is kept neutral for legacy markup. */

/* ===== Glossar ===== */
.missing-glossary {
  color: #fda4af;
  border-bottom: 1px dashed #fda4af;
  cursor: help;
}

.glossary-entry h4 {
  color: #fff;
}

.glossary-entry:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* ===== Wikipedia-Style Figure-Floats ===== */
.fig-right {
  float: right;
  clear: right;
  margin: 0.2em 0 1em 1.2em;
  max-width: 320px;
}

.fig-left {
  float: left;
  clear: left;
  margin: 0.2em 1.2em 1em 0;
  max-width: 320px;
}

.fig-center {
  display: block;
  margin: 1em auto;
  max-width: 70%;
  text-align: center;
}

.fig-thumb {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px;
  font-size: 0.85em;
}

.fig-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.fig-thumb figcaption {
  padding: 6px 4px 0;
  color: #cbd5e1;
  text-align: center;
  line-height: 1.35;
}

.content-body::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 720px) {
  .fig-right, .fig-left {
    float: none;
    margin: 1em auto;
    max-width: 100%;
  }
}

/* ===== Lightbox (Click-to-Zoom) ===== */
img.zoomable {
  cursor: zoom-in;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 2rem;
  animation: lightbox-fade-in 0.15s ease-out;
}

@keyframes lightbox-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
}

.lightbox-overlay .lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  color: #fff;
  background: none;
  border: none;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  padding: 0.2rem 0.6rem;
}

.lightbox-overlay .lightbox-close:hover {
  opacity: 1;
}

/* ===== local_python: Lokal ausfuehrbarer Code-Block ===== */
.local-py-block {
  margin: 1.5rem 0;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  overflow: hidden;
}

.local-py-code pre {
  margin: 0 !important;
  border-radius: 0 !important;
  background: #0f172a !important;
  border: none !important;
}

.local-py-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .7rem;
  background: #161b22;
  border-top: 1px solid #1f2937;
  flex-wrap: wrap;
}

.local-py-actions .local-py-filename {
  color: #94a3b8;
  font-size: .82em;
  font-family: var(--font-mono);
  margin-right: auto;
}

.local-py-actions button {
  background: #1f2937;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: .25rem .65rem;
  font-size: .82em;
  cursor: pointer;
  transition: background-color 0.1s;
}

.local-py-actions button:hover {
  background: #334155;
}

.local-py-howto {
  background: #161b22;
  border-top: 1px solid #1f2937;
}

.local-py-howto > summary {
  cursor: pointer;
  padding: .55rem .8rem;
  color: #93c5fd;
  font-weight: 500;
  user-select: none;
  list-style: none;
}

.local-py-howto > summary::-webkit-details-marker {
  display: none;
}

.local-py-howto > summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: .5rem;
  transition: transform 0.15s;
}

.local-py-howto[open] > summary::before {
  transform: rotate(90deg);
}

.local-py-prereqs {
  padding: .5rem .9rem .35rem;
  background: #0d1117;
  border-top: 1px solid #1f2937;
  color: #cbd5e1;
  font-size: .88em;
}

.local-py-prereqs strong {
  color: #fcd34d;
}

.local-py-prereqs ul {
  margin: .25rem 0 .15rem 1.1rem;
  padding: 0;
}

.local-py-prereqs a {
  color: #93c5fd;
}

.local-py-tabs {
  display: flex;
  gap: 0;
  padding: .3rem .7rem 0;
  background: #0f172a;
  border-top: 1px solid #1f2937;
}

.local-py-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  padding: .35rem .85rem;
  cursor: pointer;
  font-size: .9em;
}

.local-py-tab.active {
  color: #e2e8f0;
  border-bottom-color: #ffcb6b;
}

.local-py-tab-pane pre {
  margin: 0 !important;
  border-radius: 0 !important;
  background: #0d1117 !important;
  font-size: .85em;
}

/* ===== WebLLM-Chat-Widget ===== */
.webllm-widget {
  margin: 1.5rem 0;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: .9rem;
  font-family: var(--font-sans);
}

.webllm-title {
  color: #fcd34d;
  font-weight: 500;
  margin-bottom: .5rem;
}

.webllm-banner {
  padding: .55rem .8rem;
  border-radius: 6px;
  margin-bottom: .6rem;
  font-size: .92em;
}

.webllm-banner-info {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
}

.webllm-banner-warning {
  background: #422006;
  border: 1px solid #7c2d12;
  color: #fdba74;
}

.webllm-load-btn {
  background: #ffcb6b;
  color: #0f172a;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: .4rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .12s;
}

.webllm-load-btn:hover {
  background: #fde68a;
}

.webllm-progress-track {
  background: #1e293b;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  border: 1px solid #334155;
}

.webllm-progress-bar {
  background: #ffcb6b;
  height: 100%;
  width: 0%;
  transition: width .15s ease-out;
}

.webllm-status {
  color: #cbd5e1;
  font-size: .9em;
  padding-bottom: .55rem;
  border-bottom: 1px solid #1f2937;
  margin-bottom: .55rem;
}

.webllm-status-tokrate {
  color: #94a3b8;
  font-size: .85em;
  margin-left: .3rem;
}

.webllm-chat {
  background: #0d1117;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: .6rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: .55rem;
  min-height: 120px;
}

.webllm-bubble {
  padding: .5rem .7rem;
  border-radius: 8px;
  max-width: 92%;
  white-space: pre-wrap;
  font-size: .92em;
  line-height: 1.45;
}

.webllm-bubble-user {
  background: #1e3a8a;
  color: #e2e8f0;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.webllm-bubble-assistant {
  background: #1f2937;
  color: #e2e8f0;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.webllm-bubble-error {
  background: #7f1d1d !important;
  color: #fecaca !important;
}

.webllm-input-row {
  display: flex;
  gap: .4rem;
  align-items: stretch;
}

.webllm-input {
  flex: 1 1 auto;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: .45rem .6rem;
  font-family: var(--font-sans);
  font-size: .92em;
  resize: vertical;
  min-height: 2.5rem;
}

.webllm-input:focus {
  outline: none;
  border-color: #ffcb6b;
}

.webllm-send-btn {
  background: #ffcb6b;
  color: #0f172a;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: .45rem .9rem;
  font-weight: 600;
  cursor: pointer;
}

.webllm-send-btn:disabled {
  opacity: .5;
  cursor: wait;
}

.webllm-reset-btn {
  background: #1f2937;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: .45rem .65rem;
  cursor: pointer;
}

.webllm-disclaimer {
  background: #422006;
  border: 1px solid #7c2d12;
  color: #fdba74;
  padding: .4rem .65rem;
  border-radius: 6px;
  font-size: .82em;
  margin-bottom: .55rem;
  line-height: 1.4;
}

/* ===== pgllm Activate-Modal (Pyodide-Bruecke zu WebLLM) ===== */
.pgllm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pgllm-modal {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1.4rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  font-family: var(--font-sans);
}

.pgllm-modal h3 {
  margin: 0 0 .6rem 0;
  color: #fcd34d;
  font-size: 1.2rem;
}

.pgllm-modal p {
  margin: .35rem 0;
  font-size: .92em;
  line-height: 1.5;
}

.pgllm-modal ul {
  margin: .3rem 0 .8rem 1.1rem;
  font-size: .9em;
  color: #cbd5e1;
}

.pgllm-modal code {
  background: #1f2937;
  color: #ffcb6b;
  padding: .12rem .35rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: .9em;
}

.pgllm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .9rem;
}

.pgllm-modal-cancel {
  background: #1f2937;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: .45rem 1rem;
  cursor: pointer;
}

.pgllm-modal-confirm {
  background: #ffcb6b;
  color: #0f172a;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: .45rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

.pgllm-modal-progress {
  margin-top: .9rem;
}

.pgllm-modal-progress-text {
  color: #cbd5e1;
  font-size: .85em;
  margin-bottom: .3rem;
}

.pgllm-modal-progress-track {
  background: #1e293b;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  border: 1px solid #334155;
}

.pgllm-modal-progress-bar {
  background: #ffcb6b;
  height: 100%;
  width: 0%;
  transition: width .15s ease-out;
}

/* ===== pgmcp Game-Modal (LLM-generierte Spiel-Snippets im Overlay) ===== */
.pgmcp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: pgmcpFadeIn 0.18s ease;
}
@keyframes pgmcpFadeIn { from { opacity: 0; } to { opacity: 1; } }

.pgmcp-modal {
  background: #1a1a2e;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 12px;
  max-width: 760px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.85);
  font-family: var(--font-sans);
}

.pgmcp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #1e293b, #312e81);
  border-bottom: 1px solid #475569;
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.pgmcp-modal-title {
  color: #fcd34d;
  font-weight: 600;
  font-size: 1.02rem;
}

.pgmcp-modal-close {
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.45em;
  border-radius: 4px;
}
.pgmcp-modal-close:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }

.pgmcp-modal-body {
  padding: 0.9rem 1rem 1rem;
}

.pgmcp-modal-body .pywasm-widget { margin: 0; }

/* ===== KI-Glossar Wiki-Style Layout ===== */
.glossary-page .glossary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #1f2937;
}

.glossary-header-text {
  flex: 1 1 auto;
}

.glossary-header-text p {
  font-size: .92em;
  max-width: 64ch;
}

.glossary-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.glossary-search {
  position: relative;
  flex: 1 1 auto;
  max-width: 480px;
}

.glossary-search i {
  position: absolute;
  top: 50%;
  left: .75rem;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.glossary-search input {
  width: 100%;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: .55rem .75rem .55rem 2.1rem;
  font-size: .95em;
  font-family: var(--font-sans);
}

.glossary-search input:focus {
  outline: none;
  border-color: #ffcb6b;
  box-shadow: 0 0 0 3px rgba(255, 203, 107, 0.18);
}

.glossary-meta {
  color: #94a3b8;
  font-size: .85em;
  white-space: nowrap;
}

.glossary-az-index {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .2rem 0 1.4rem;
  padding: .55rem .75rem;
  background: #161b22;
  border: 1px solid #1f2937;
  border-radius: 8px;
}

.glossary-az-link {
  color: #ffcb6b;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: .92em;
  padding: .15rem .55rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color .12s;
}

.glossary-az-link:hover {
  background: rgba(255, 203, 107, 0.14);
  text-decoration: none;
}

.glossary-az-link.disabled {
  color: #475569;
  pointer-events: none;
}

.glossary-group {
  margin-bottom: 1.6rem;
}

.glossary-letter {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: #ffcb6b;
  margin: 0 0 .55rem 0;
  padding: 0 0 .25rem 0;
  border-bottom: 2px solid #334155;
}

.glossary-entries {
  display: flex;
  flex-direction: column;
}

.glossary-entry {
  border-bottom: 1px solid #1f2937;
  padding: .85rem 0;
}

.glossary-entry:last-child {
  border-bottom: none;
}

.glossary-entry-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.glossary-entry-link:hover {
  text-decoration: none;
}

.glossary-entry-link:hover .glossary-entry-title {
  color: #ffcb6b;
}

.glossary-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .25rem;
}

.glossary-entry-title {
  margin: 0;
  font-size: 1.1rem;
  color: #e2e8f0;
  font-weight: 600;
  transition: color .12s;
}

.glossary-entry-preview {
  margin: 0;
  color: #cbd5e1;
  font-size: .9em;
  line-height: 1.5;
}

.glossary-empty {
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
  background: #161b22;
  border: 1px dashed #334155;
  border-radius: 8px;
}

@media (max-width: 600px) {
  .glossary-page .glossary-header {
    flex-direction: column;
    align-items: stretch;
  }
  .glossary-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .glossary-search {
    max-width: none;
  }
  .glossary-meta {
    text-align: right;
  }
}

/* ===== Wordle-Mini-Tiles für Inline-Beispiele in Blog-Artikeln =====
 * Sieht aus wie das Spiel: Buchstabe in farbiger Box (grau/gelb/grün),
 * inline mit Text einsetzbar. */
.wordle-mini-row {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
  margin: 0 2px;
}
.wordle-mini-tile {
  display: inline-block;
  min-width: 1.5em;
  padding: 0.15em 0.45em;
  text-align: center;
  font-weight: 700;
  color: white;
  border-radius: 3px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wordle-mini-tile-gray   { background-color: #787c7e; }
.wordle-mini-tile-yellow { background-color: #b59f3b; }
.wordle-mini-tile-green  { background-color: #538d4e; }

/* ===== Reviews ===== */

/* Intro-Block auf /reviews/ */
.reviews-intro {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
}

.reviews-intro h1 {
  color: #e2e8f0;
}

.reviews-intro-body {
  color: #cbd5e1;
  line-height: 1.55;
}

/* Aktualitaets-Badge (obsolete / aging / current / timeless) */
.obsolescence-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  margin-right: 0.4rem;
  margin-bottom: 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}

.obsolescence-badge i {
  font-size: 0.85em;
  line-height: 1;
}

/* Icon-only-Variante (rechts neben Titel im Listing + Detail-Header) */
.obsolescence-badge--icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
}

.obsolescence-badge--icon i {
  font-size: 0.95rem;
  margin: 0;
}

.obsolescence-obsolete {
  background-color: rgba(244, 114, 114, 0.18);
  color: #f47272;
  border: 1px solid rgba(244, 114, 114, 0.4);
}

.obsolescence-timeless {
  background-color: rgba(95, 200, 130, 0.16);
  color: #5fc882;
  border: 1px solid rgba(95, 200, 130, 0.4);
}

.obsolescence-aging {
  background-color: rgba(240, 200, 80, 0.16);
  color: #f0c850;
  border: 1px solid rgba(240, 200, 80, 0.4);
}

.obsolescence-current {
  background-color: rgba(163, 217, 119, 0.16);
  color: #a3d977;
  border: 1px solid rgba(163, 217, 119, 0.4);
}

/* Kompakte Badge-Legende auf der Rezensions-Uebersicht (responsives Grid) */
.reviews-badge-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 1.4rem;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 1.1rem;
}
.reviews-badge-legend .rbl-item { display: flex; align-items: center; gap: 0.45rem; }
.reviews-badge-legend .obsolescence-badge { flex: 0 0 auto; }

/* "Rezension:"-Praefix dezenter als der Buchtitel */
.review-prefix {
  color: #94a3b8;
  font-weight: 400;
  font-size: 0.78em;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-right: 0.4em;
}

/* Header: Cover links, Bibliographie rechts */
.review-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-top: 1rem;
}

.review-cover {
  flex: 0 0 auto;
  width: min(220px, 35%);
}

.review-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.review-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.review-subtitle {
  font-style: italic;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.review-authors {
  margin-bottom: 0.5rem;
}

.review-biblio {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.92em;
  color: #cbd5e1;
}

.review-biblio li {
  padding: 0.15rem 0;
}

.review-biblio strong {
  color: #e2e8f0;
}

.review-original {
  font-size: 0.9em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.review-original summary {
  cursor: pointer;
  color: #94a3b8;
}

.review-overall {
  margin-top: 0.75rem;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.review-overall-value {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 1.05rem;
}

@media (max-width: 640px) {
  .review-header {
    flex-direction: column;
  }
  .review-cover {
    width: min(180px, 60%);
    align-self: center;
  }
}

/* Bewertungs-Block: 5 Sterne pro Zeile, kein Tabellen-Hintergrund */
.review-rating-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.55rem 1.2rem;
  align-items: center;
  margin: 0.8rem 0 0;
  background: transparent;
}

.review-rating-grid dt {
  font-weight: 500;
  color: #cbd5e1;
}

.review-rating-grid dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.review-rating-grid dt.rating-total,
.review-rating-grid dd.rating-total {
  margin-top: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  color: #e2e8f0;
}

.rating-stars {
  display: inline-flex;
  gap: 0.12rem;
  font-size: 0.95rem;
}

.rating-value {
  font-size: 0.9em;
  color: #94a3b8;
}

.review-rating-grid dd.rating-total .rating-value {
  color: #e2e8f0;
}

/* Aufklapp-Block "Kapitel fuer Kapitel" */
.review-extended > summary {
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  color: #79c0ff;
  list-style: none;
  padding: 0.4rem 0;
}

.review-extended > summary::-webkit-details-marker {
  display: none;
}

.review-extended > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.15s ease;
}

.review-extended[open] > summary::before {
  transform: rotate(90deg);
}

/* ===== Zitate (Blockquotes) im Content-Body schoener ===== */
.content-body blockquote {
  position: relative;
  border-left: 3px solid #58a6ff;
  background-color: rgba(88, 166, 255, 0.06);
  color: #cbd5e1;
  font-style: italic;
  padding: 0.9rem 1.2rem 0.9rem 2.6rem;
  margin: 1.6rem 0;
  border-radius: 0 6px 6px 0;
}

.content-body blockquote::before {
  content: "\201E"; /* deutsche oeffnende Anfuehrungszeichen */
  position: absolute;
  left: 0.6rem;
  top: 0.1rem;
  font-size: 2.6rem;
  line-height: 1;
  color: rgba(88, 166, 255, 0.45);
  font-family: Georgia, "Times New Roman", serif;
  font-style: normal;
}

.content-body blockquote p {
  margin: 0;
}

.content-body blockquote p + p {
  margin-top: 0.5rem;
}
