/* =========================================================
   POT Seitenverzeichnis
   Reines Usability-Widget. Kein Schema/JSON-LD, keine SEO-Auszeichnung.
   ========================================================= */
:root{
  --pot-toc-blue: #07387B;
  --pot-toc-blue-soft: rgba(7, 56, 123, .08);
  --pot-toc-orange: #f28c18;
  --pot-toc-text: #263241;
  --pot-toc-muted: #64748b;
  --pot-toc-border: rgba(7, 56, 123, .12);
  --pot-toc-shadow: 0 18px 42px rgba(7, 56, 123, .16);
}

.pot-toc,
.pot-toc *,
.pot-toc *::before,
.pot-toc *::after{
  box-sizing: border-box;
}

.pot-toc[hidden]{
  display: none !important;
}

.pot-toc{
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  z-index: 9997;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pot-toc__toggle{
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--pot-toc-blue);
  color: #fff;
  box-shadow: 0 12px 30px rgba(7, 56, 123, .22);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  position: relative;
}

.pot-toc__toggle::after{
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--pot-toc-orange);
  opacity: .95;
}

.pot-toc__toggle svg{
  width: 23px;
  height: 23px;
  display: block;
}

.pot-toc__directory-icon .pot-toc__icon-accent{
  fill: var(--pot-toc-orange);
}

.pot-toc__toggle:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(7, 56, 123, .26);
}

.pot-toc__toggle:focus-visible{
  outline: 3px solid rgba(242, 140, 24, .46);
  outline-offset: 3px;
}

.pot-toc__panel{
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  width: min(340px, calc(100vw - 96px));
  max-height: min(calc(100svh - 40px), 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--pot-toc-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--pot-toc-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(-50% + 8px)) scale(.98);
  transform-origin: center right;
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.pot-toc.is-open .pot-toc__panel{
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

.pot-toc__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: 14px 14px 11px;
  border-bottom: 1px solid rgba(7, 56, 123, .08);
}

.pot-toc__title{
  color: var(--pot-toc-blue);
  font-weight: 900;
  font-size: .94rem;
  letter-spacing: .01em;
  line-height: 1.25;
}

.pot-toc__close{
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(7, 56, 123, .06);
  color: var(--pot-toc-blue);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(7, 56, 123, .10);
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.pot-toc__close:hover,
.pot-toc__close:focus-visible{
  background: rgba(242, 140, 24, .10);
  color: var(--pot-toc-orange);
  box-shadow: inset 0 0 0 1px rgba(242, 140, 24, .28);
  transform: translateY(-1px);
}

.pot-toc__close svg{
  width: 21px;
  height: 21px;
  display: block;
}

.pot-toc__list{
  margin: 0;
  padding: 8px;
  list-style: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(7, 56, 123, .36) rgba(7, 56, 123, .06);
}

.pot-toc__list::-webkit-scrollbar{
  width: 8px;
}

.pot-toc__list::-webkit-scrollbar-track{
  background: rgba(7, 56, 123, .06);
  border-radius: 999px;
}

.pot-toc__list::-webkit-scrollbar-thumb{
  background: rgba(7, 56, 123, .36);
  border-radius: 999px;
}

.pot-toc__item{
  margin: 0;
}

.pot-toc__link{
  position: relative;
  display: block;
  width: 100%;
  padding: 10px 10px 10px 28px;
  border-radius: 12px;
  color: var(--pot-toc-blue) !important;
  text-decoration: none !important;
  font-weight: 750;
  font-size: .9rem;
  line-height: 1.35;
  transition: background .18s ease, color .18s ease;
}

.pot-toc__link:visited{
  color: var(--pot-toc-blue) !important;
}

.pot-toc__link::before{
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(7, 56, 123, .32);
  transform: translateY(-50%);
}

.pot-toc__link:hover,
.pot-toc__link:focus-visible{
  background: var(--pot-toc-blue-soft);
  color: var(--pot-toc-blue) !important;
  outline: none;
}

.pot-toc__link.is-active{
  background: rgba(242, 140, 24, .11);
  color: var(--pot-toc-orange) !important;
}

.pot-toc__link.is-active::before{
  width: 8px;
  height: 8px;
  background: var(--pot-toc-orange);
  box-shadow: 0 0 0 4px rgba(242, 140, 24, .14);
}

.pot-toc__sr{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Zielabschnitte bekommen Abstand unter fixen Headern. */
.pot-toc-anchor{
  scroll-margin-top: 96px;
}

@media (max-width: 720px){
  .pot-toc{
    left: auto;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    top: auto;
    transform: none;
  }

  .pot-toc__toggle{
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .pot-toc__panel{
    left: auto;
    right: 0;
    top: auto;
    bottom: calc(100% + 12px);
    width: min(330px, calc(100vw - 28px));
    max-height: min(calc(100svh - 96px), 460px);
    transform: translateY(8px) scale(.98);
    transform-origin: bottom right;
  }

  .pot-toc.is-open .pot-toc__panel{
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce){
  .pot-toc__toggle,
  .pot-toc__panel,
  .pot-toc__link,
  .pot-toc__close{
    transition: none !important;
  }
}
