/* ProTactics R20.20 – Seitenverlauf, interaktive Desktop-/iPad-Kapsel. */
.pt-scroll-progress {
  --pt-gold: #e4c174;
  --pt-fg: #f7f7f8;
  --pt-dark: rgba(12, 13, 17, .79);
  --pt-scroll-offset: 70px;
  position: fixed;
  right: clamp(5px, 1.45vw, 22px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--pt-fg);
}
.pt-scroll-progress, .pt-scroll-progress * { box-sizing: border-box; }
.pt-scroll-progress__capsule {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 42px;
  min-height: 54px;
  max-height: min(65vh, 500px);
  overflow: auto;
  scrollbar-width: none;
  padding: 14px 0;
  gap: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.15);
  background: var(--pt-dark);
  box-shadow: 0 10px 35px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  appearance: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.pt-scroll-progress__capsule::-webkit-scrollbar { display: none; }
.pt-scroll-progress__capsule:hover,
.pt-scroll-progress__capsule[aria-expanded="true"] {
  border-color: rgba(228,193,116,.48);
  background: rgba(18,19,24,.92);
}
.pt-scroll-progress__marker {
  display: grid;
  place-items: center;
  width: 32px;
  height: 14px;
  flex: 0 0 auto;
  cursor: pointer;
}
.pt-scroll-progress__marker.is-active { height: 45px; }
@media (hover: hover) and (pointer: fine) {
  .pt-scroll-progress__marker:not(.is-active):hover .pt-scroll-progress__track {
    width: 6px;
    height: 6px;
    background: var(--pt-gold);
  }
}
.pt-scroll-progress__track {
  position: relative;
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(223,225,230,.39);
  overflow: hidden;
  transition: height .23s cubic-bezier(.2,.7,.2,1), width .23s ease, background-color .2s ease;
}
.pt-scroll-progress__marker.is-past .pt-scroll-progress__track {
  background: rgba(228,193,116,.82);
}
.pt-scroll-progress__marker.is-active .pt-scroll-progress__track {
  width: 6px;
  height: 35px;
  background: rgba(228,193,116,.19);
  box-shadow: inset 0 0 0 1px rgba(228,193,116,.13);
}
.pt-scroll-progress__fill {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--pt-gold);
  transform: scaleY(var(--pt-fill, 0));
  transform-origin: center top;
  opacity: 0;
}
.pt-scroll-progress__marker.is-active .pt-scroll-progress__fill { opacity: 1; }
.pt-scroll-progress__capsule:focus-visible,
.pt-scroll-progress__link:focus-visible,
.pt-scroll-progress__close:focus-visible {
  outline: 2px solid var(--pt-gold);
  outline-offset: 3px;
}
.pt-scroll-progress__panel {
  position: absolute;
  top: 50%;
  right: calc(100% + 11px);
  transform: translateY(-50%);
  width: min(275px, calc(100vw - 70px));
  max-height: min(75vh, 590px);
  overflow: auto;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 19px;
  background: rgba(17,18,23,.97);
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}
.pt-scroll-progress__panel[hidden] { display: none; }
.pt-scroll-progress__panel-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin: 0 0 8px 5px; }
.pt-scroll-progress__heading { font-size: 11px; line-height: 1.4; letter-spacing: .11em; text-transform: uppercase; color: rgba(255,255,255,.68); font-weight: 750; }
.pt-scroll-progress__close { appearance:none; background: transparent; color: rgba(255,255,255,.8); border:0; cursor:pointer; border-radius: 8px; padding: 5px 8px; font-size: 20px; line-height:1; }
.pt-scroll-progress__links { display: flex; flex-direction: column; gap: 3px; }
.pt-scroll-progress__link { display: flex; align-items: center; gap: 10px; width:100%; min-height: 43px; padding: 9px 10px; color: var(--pt-fg); font: inherit; font-size: 13px; text-align:left; border:0; border-radius: 10px; background: transparent; cursor:pointer; }
.pt-scroll-progress__link::before { content:''; width: 5px; height: 5px; flex: 0 0 5px; border-radius: 100%; background: rgba(255,255,255,.35); }
.pt-scroll-progress__link.is-active { background: rgba(228,193,116,.15); color: var(--pt-gold); font-weight: 650; }
.pt-scroll-progress__link.is-active::before { background: var(--pt-gold); }
.pt-scroll-progress__link:hover { background: rgba(255,255,255,.1); }
@media (max-width: 640px) {
  .pt-scroll-progress { right: 4px; }
  .pt-scroll-progress__capsule { width: 40px; gap: 0; padding: 12px 0; max-height: 60vh; }
  .pt-scroll-progress__marker { height: 12px; }
  .pt-scroll-progress__marker.is-active { height: 43px; }
  .pt-scroll-progress__marker.is-active .pt-scroll-progress__track { height: 31px; }
  .pt-scroll-progress__panel { right: calc(100% + 7px); width: min(270px, calc(100vw - 59px)); }
}
@media (max-height: 490px) {
  .pt-scroll-progress__capsule { max-height: 54vh; gap: 0; padding: 9px 0; }
  .pt-scroll-progress__marker { height: 10px; }
  .pt-scroll-progress__marker.is-active { height: 41px; }
  .pt-scroll-progress__panel { max-height: 80vh; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-scroll-progress *, .pt-scroll-progress *::before, .pt-scroll-progress *::after { transition: none !important; }
}

/* Hover-Hinweis ausschließlich außerhalb der Capsule, damit er nicht abgeschnitten wird. */
.pt-scroll-progress__tooltip {
  position: absolute;
  right: calc(100% + 11px);
  transform: translateY(-50%);
  width: max-content;
  max-width: min(240px, calc(100vw - 72px));
  padding: 8px 12px;
  border: 1px solid rgba(228,193,116,.25);
  border-radius: 11px;
  background: rgba(17,18,23,.97);
  box-shadow: 0 9px 24px rgba(0,0,0,.34);
  color: #f7f7f8;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  pointer-events: none;
  z-index: 2;
}
.pt-scroll-progress__tooltip[hidden] { display: none; }
.pt-scroll-progress__tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -5px;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(17,18,23,.97);
  border-top: 1px solid rgba(228,193,116,.25);
  border-right: 1px solid rgba(228,193,116,.25);
}
@media (hover: none) {
  .pt-scroll-progress__tooltip { display: none; }
}

/* R20.17: kompakte Anzeige fuer iPhone/iPad.
   Die sichtbare Kapsel schrumpft; die unsichtbare 44px-Tippflaeche bleibt.
   Desktop-Styling und Touch-Abschnittsmenue bleiben unveraendert. */
@media (max-width: 1024px), (any-pointer: coarse) {
  .pt-scroll-progress { right: -4px; }
  .pt-scroll-progress::before {
    content: '';
    position: absolute;
    inset: 0 8px;
    z-index: 0;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    background: var(--pt-dark);
    box-shadow: 0 8px 24px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.05);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transition: border-color .2s ease, background .2s ease;
  }
  .pt-scroll-progress:hover::before,
  .pt-scroll-progress:focus-within::before {
    border-color: rgba(228,193,116,.48);
    background: rgba(18,19,24,.92);
  }
  .pt-scroll-progress__capsule,
  .pt-scroll-progress__capsule:hover,
  .pt-scroll-progress__capsule[aria-expanded="true"] {
    position: relative;
    z-index: 1;
    width: 44px;
    min-height: 0;
    max-height: min(48vh, 330px);
    max-height: min(48dvh, 330px);
    padding: 7px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .pt-scroll-progress__marker { width: 44px; height: 9px; }
  .pt-scroll-progress__marker.is-active { height: 30px; }
  .pt-scroll-progress__track { width: 3px; height: 3px; }
  .pt-scroll-progress__marker.is-active .pt-scroll-progress__track { width: 5px; height: 23px; }
  .pt-scroll-progress__panel { right: calc(100% + 4px); }
  .pt-scroll-progress__tooltip { right: calc(100% + 4px); }
}
/* Auf schmalen Smartphones und im Smartphone-Querformat noch kompakter. */
@media (max-width: 640px), (max-height: 500px) and (any-pointer: coarse) {
  .pt-scroll-progress::before { left: 10px; right: 10px; }
  .pt-scroll-progress__capsule,
  .pt-scroll-progress__capsule:hover,
  .pt-scroll-progress__capsule[aria-expanded="true"] {
    max-height: min(43vh, 260px);
    max-height: min(43dvh, 260px);
    padding: 6px 0;
  }
  .pt-scroll-progress__marker { height: 8px; }
  .pt-scroll-progress__marker.is-active { height: 27px; }
  .pt-scroll-progress__marker.is-active .pt-scroll-progress__track { height: 20px; }
}

/* R20.19: iPhone progress follows the actual rim of the existing Bottom-Island.
   No separate overlay and no change to the iPad/desktop navigation.
   All SVG layers ignore pointer events so the existing menu remains usable. */
.pt-island-contour { display:none; }
@media (max-width: 699px),
       (hover: none) and (pointer: coarse) and (max-height: 500px),
       (min-width: 700px) and (max-width: 899px) and (hover: hover) and (pointer: fine) {
  .pt-scroll-progress { display:none !important; }
  .touch-pill { position:relative; isolation:isolate; }
  .pt-island-contour {
    display:block;
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    overflow:visible;
    z-index:2;
    pointer-events:none;
  }
  .pt-island-contour path { fill:none; stroke-linecap:round; stroke-linejoin:round; }
  .pt-island-contour__track { stroke:rgba(255,255,255,.16); stroke-width:1.2; }
  .pt-island-contour__filled { stroke:#b66c12; stroke-width:1.85; }
  .pt-island-contour__segments path { stroke-width:1.85; }
  .pt-island-contour__reverse path {
    stroke:#f3a021; stroke-width:2.5; stroke-linecap:round;
    filter:drop-shadow(0 0 2px rgba(244,151,17,.52));
  }
  .pt-island-contour__tip-glow { fill:#ffb735; opacity:.11; transition:opacity .8s ease; }
  .touch-pill.pt-island-scrolling .pt-island-contour__tip-glow {
    opacity:.48; transition:opacity .12s ease;
  }
  .pt-island-contour__tip-dot { fill:#ffd57b; }
  .pt-island-contour__start-dot { fill:#f5b323; }
  /* The real scroll value is not delayed; only brightness fades at rest. */
  .pt-island-contour__progress-layer { opacity:.74; transition:opacity .8s ease; }
  .touch-pill.pt-island-scrolling .pt-island-contour__progress-layer {
    opacity:1; transition:opacity .12s ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pt-island-contour__progress-layer,
  .pt-island-contour__tip-glow { transition:none !important; }
  .pt-island-contour__reverse { display:none !important; }
}

/* R20.20 – kräftigere, aber lokale Desktop-/iPad-Effekte.
   Mobil-Umriss der Bottom-Island bleibt ausschließlich R20.19. */
.pt-scroll-progress__marker.is-past .pt-scroll-progress__track {
  background: #b47519;
  box-shadow: 0 0 4px rgba(239,158,20,.18);
}
.pt-scroll-progress__marker.is-active .pt-scroll-progress__track {
  background: rgba(190,105,11,.20);
  box-shadow: inset 0 0 0 1px rgba(244,180,0,.20), 0 0 11px rgba(222,126,16,.23);
}
.pt-scroll-progress__marker.is-active .pt-scroll-progress__fill {
  background: linear-gradient(180deg,#b76a11 0%,#df8a12 58%,#f4b400 86%,#ffd375 100%);
  box-shadow: 0 0 5px rgba(245,178,22,.35);
}
.pt-scroll-progress__tip {
  position:absolute;
  z-index:2;
  display:none;
  left:0;
  right:0;
  top:calc(var(--pt-fill,0) * 100%);
  height:4px;
  border-radius:999px;
  background:#ffd477;
  transform:translateY(-50%);
  opacity:.36;
  box-shadow:0 0 6px rgba(250,174,22,.55);
  transition:opacity .75s ease;
  pointer-events:none;
}
.pt-scroll-progress__marker.is-active .pt-scroll-progress__tip { display:block; }
.pt-scroll-progress.is-scrolling .pt-scroll-progress__marker.is-active .pt-scroll-progress__tip {
  opacity:1;
  transition:opacity .10s ease;
}
.pt-scroll-progress__reverse-ghost {
  position:absolute;
  z-index:3;
  left:0;
  width:100%;
  border-radius:999px;
  pointer-events:none;
  background:linear-gradient(180deg,#ffd477,#e88917);
  box-shadow:0 0 5px rgba(242,152,21,.45);
}
.pt-scroll-progress__capsule:hover,
.pt-scroll-progress__capsule[aria-expanded="true"] {
  border-color:rgba(244,180,0,.42);
}
@media (hover:hover) and (pointer:fine) {
  .pt-scroll-progress__marker:not(.is-active):hover .pt-scroll-progress__track {
    background:#f4b400;
    box-shadow:0 0 7px rgba(244,180,0,.45);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pt-scroll-progress__tip { transition:none!important;box-shadow:none!important; }
  .pt-scroll-progress__reverse-ghost { display:none!important; }
}

/* R20.21 – dezenteres Format bei schmalen Desktopfenstern. */
@media (min-width:700px) and (max-width:1100px) and (hover:hover) and (pointer:fine) {
  .pt-scroll-progress__capsule {width:32px;}
  .pt-scroll-progress__marker {width:30px;}
}
@media (min-width:700px) and (max-width:1100px) and (hover:none) and (pointer:coarse) {
  .pt-scroll-progress::before {left:11px;right:11px;}
}

/* R20.23: Auf schmalen Mac-Fenstern übernimmt die schon vorhandene
   Bottom-Island den Fortschritt – keine zweite feste Klickfläche neben
   der Browser-Scrollleiste. Ab 900px bleibt die rechte Navigation mit
   sicherem Abstand zur Scrollleiste erhalten. */
@media (min-width: 700px) and (max-width: 899px) and (hover: hover) and (pointer: fine) {
  .pt-scroll-progress { display: none !important; }
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .pt-scroll-progress { right: clamp(26px, 3vw, 40px); }
}
@media (min-width: 700px) and (pointer: coarse) {
  /* Der Touch-Bereich bleibt breit, aber der sichtbare Rand liegt
     vollständig innerhalb des Viewports. */
  .pt-scroll-progress { right: 8px; }
}
