/* ==========================================================================
   timeline.css – „Faden-Verlauf“: Verläufe als Faden mit Knoten
   Jeder Knoten ist ein Meilenstein. erledigt = gefüllt · jetzt = Knoten mit Hof ·
   offen = hohl, der Faden dorthin gestrichelt. Abweichung: data-state="attn" (Raute) ·
   "cancelled" (durchgestrichen).

   <ol class="a-thread">
     <li class="a-thread__step" data-state="done">
       <span class="a-thread__knot" aria-hidden="true"></span>
       <div class="a-thread__body">
         <p class="a-thread__title">Angefragt <span class="sr-only">(erledigt)</span></p>
         <p class="a-thread__meta"><time class="a-time" datetime="…" title="Mo, 28. Sep. 2026, 14:12 Uhr">28. Sep., 14:12</time> · über die Website</p>
       </div>
     </li> …
   </ol>
   Varianten: .a-thread--compact (Schubfach) · .a-thread--h (waagerecht, Lebenslauf einer Buchung)

   Verbunden (Buchung ↔ Gast ↔ Nachrichten):  .a-relations > li > .a-relations__item
   Protokoll (Sync):  .a-log > .a-log__entry[data-kind="import|change|remove|conflict|error|check"]
   Storno-Regeln:     .a-policy (Zeitleiste vor der Anreise; ACP und Gast sehen dasselbe Bild)
   ========================================================================== */

.a-thread {
  --a-th-x: .625rem;          /* Fadenachse */
  --a-th-indent: 2rem;
  --a-th-gap: 1.1rem;
  --a-th-knot-top: .4rem;     /* Knotenmitte = erste Zeile */
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.a-thread__step {
  position: relative;
  padding-left: var(--a-th-indent);
  padding-bottom: var(--a-th-gap);
}
.a-thread__step:last-child { padding-bottom: 0; }
/* Faden-Stück zum nächsten Knoten */
.a-thread__step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(var(--a-th-x) - var(--a-thread-w) / 2);
  top: calc(var(--a-th-knot-top) + .5rem);
  bottom: calc(-1 * var(--a-th-knot-top) + .3rem);
  width: var(--a-thread-w);
  background: var(--a-thread);
}
/* zum offenen Knoten: gestrichelt */
.a-thread__step:has(+ .a-thread__step:is([data-state="open"], [data-state="cancelled"]))::before,
.a-thread__step[data-state="open"]::before {
  background: repeating-linear-gradient(to bottom, var(--a-thread-open) 0 4px, transparent 4px 8px);
}
.a-thread__knot {
  position: absolute;
  left: calc(var(--a-th-x) - var(--a-knot) / 2);
  top: calc(var(--a-th-knot-top) + .5rem - var(--a-knot) / 2);
  width: var(--a-knot);
  height: var(--a-knot);
  border-radius: 50%;
  background: var(--a-thread);
  box-shadow: 0 0 0 2.5px var(--a-raised, var(--a-surface));
}
.a-thread__step[data-state="current"] .a-thread__knot {
  --a-knot: var(--a-knot-lg);
  box-shadow: 0 0 0 2.5px var(--a-surface), 0 0 0 5.5px color-mix(in srgb, var(--a-thread) 22%, transparent);
}
/* der Knoten „sitzt“: kleiner Querstich */
.a-thread__step[data-state="current"] .a-thread__knot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.5px solid var(--a-surface);
  border-left-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(-20deg);
  opacity: .8;
}
.a-thread__step[data-state="open"] .a-thread__knot {
  background: var(--a-surface);
  box-shadow: inset 0 0 0 1.5px var(--a-thread-open), 0 0 0 2.5px var(--a-surface);
}
.a-thread__step[data-state="attn"] .a-thread__knot {
  border-radius: 2px;
  transform: rotate(45deg) scale(.95);
  background: var(--a-attn-fill);
}
.a-thread__step[data-state="cancelled"] .a-thread__knot {
  background: var(--a-surface);
  box-shadow: inset 0 0 0 1.5px var(--a-neutral-fill), 0 0 0 2.5px var(--a-surface);
}
.a-thread__step[data-state="cancelled"] .a-thread__knot::after {
  content: "";
  position: absolute;
  inset: 4px 1px;
  border-top: 1.5px solid var(--a-neutral-fill);
  transform: rotate(-45deg);
  transform-origin: center;
  top: 50%;
  height: 0;
}
.a-thread__body { display: grid; gap: .15rem; min-width: 0; }
.a-thread__title { font-weight: 600; color: var(--fg); line-height: 1.35; }
.a-thread__step[data-state="open"] .a-thread__title { font-weight: 500; color: var(--fg-2); }
.a-thread__step[data-state="cancelled"] .a-thread__title { color: var(--fg-2); text-decoration: line-through; text-decoration-color: var(--a-line-3); }
.a-thread__step[data-state="attn"] .a-thread__title { color: var(--a-attn); }
.a-thread__meta { font-size: var(--a-fs-sm); color: var(--fg-2); font-variant-numeric: tabular-nums lining-nums; }
.a-thread__text { font-size: var(--a-fs-sm); color: var(--fg); margin-top: .2rem; line-height: 1.45; }
.a-thread__action { margin-top: .4rem; }
.a-thread--compact { --a-th-gap: .75rem; --a-th-indent: 1.6rem; --a-th-x: .5rem; }
.a-thread--compact .a-thread__title { font-size: var(--a-fs-base); }

/* Waagerecht: Lebenslauf einer Buchung (Angefragt → Bestätigt → Bezahlt → Angereist → Abgereist) */
.a-thread--h {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
}
.a-thread--h .a-thread__step {
  padding: 1.35rem .5rem 0 0;
  min-width: 0;
}
.a-thread--h .a-thread__step:not(:last-child)::before {
  left: calc(var(--a-knot) / 2 + 4px);
  right: 4px;
  top: calc(.35rem - var(--a-thread-w) / 2 + var(--a-knot) / 2);
  bottom: auto;
  width: auto;
  height: var(--a-thread-w);
}
.a-thread--h .a-thread__step:has(+ .a-thread__step:is([data-state="open"], [data-state="cancelled"]))::before,
.a-thread--h .a-thread__step[data-state="open"]::before {
  background: repeating-linear-gradient(to right, var(--a-thread-open) 0 4px, transparent 4px 8px);
}
.a-thread--h .a-thread__knot { left: 0; top: .35rem; }
.a-thread--h .a-thread__step[data-state="current"] .a-thread__knot { top: calc(.35rem - 2px); left: -2px; }
.a-thread--h .a-thread__title { font-size: var(--a-fs-sm); }
.a-thread--h .a-thread__meta { font-size: var(--a-fs-xs); }
@media (max-width: 479.98px) {
  .a-thread--h .a-thread__meta { display: none; }
  .a-thread--h .a-thread__title { font-size: var(--a-fs-xs); }
}

/* ---- Verbunden: Buchung ↔ Gast ↔ Nachrichten ------------------------------------------------ */
.a-relations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.a-relations > li { position: relative; display: inline-flex; align-items: center; }
.a-relations > li + li { padding-left: 1.75rem; }
.a-relations > li + li::before {   /* Faden */
  content: "";
  position: absolute;
  left: .2rem;
  right: calc(100% - 1.55rem);
  top: 50%;
  height: var(--a-thread-w);
  margin-top: calc(var(--a-thread-w) / -2);
  background: var(--a-thread);
}
.a-relations > li + li::after {   /* Knoten */
  content: "";
  position: absolute;
  left: calc(.875rem - 3.5px);
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--a-thread);
}
.a-relations__item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 1.875rem;
  padding: 0 .65rem;
  border-radius: var(--r-pill);
  background: var(--a-surface);
  box-shadow: inset 0 0 0 1px var(--a-line-2);
  color: var(--fg);
  font-size: var(--a-fs-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.a-relations__item .a-ico { width: 1rem; height: 1rem; color: var(--fg-2); }
a.a-relations__item:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.a-relations__item[aria-current] { box-shadow: inset 0 0 0 1.5px var(--a-thread); font-weight: 600; }

/* ---- Protokoll (Sync, Änderungen) ----------------------------------------------------------- */
.a-log { margin: 0; padding: 0; list-style: none; font-size: var(--a-fs-base); }
.a-log__day {
  position: sticky;
  top: 0;
  padding: .5rem 0 .35rem;
  background: var(--a-surface);
  font-size: var(--a-fs-2xs);
  font-weight: 600;
  font-stretch: 85%;
  font-variation-settings: "wdth" 85;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.a-log__entry {
  --a-log-c: var(--a-neutral-fill);
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem 1.5rem minmax(0, 1fr) auto;
  align-items: start;
  column-gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--a-line);
}
.a-log__entry:last-child { border-bottom: 0; }
.a-log__time { color: var(--fg-2); font-size: var(--a-fs-sm); font-variant-numeric: tabular-nums lining-nums; padding-top: .1rem; }
.a-log__glyph {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: .05rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--a-log-c) 16%, transparent);
  color: var(--a-log-c);
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1;
}
.a-log__entry[data-kind="import"] { --a-log-c: var(--a-ok); }
.a-log__entry[data-kind="change"] { --a-log-c: var(--a-info); }
.a-log__entry[data-kind="remove"] { --a-log-c: var(--a-neutral); }
.a-log__entry[data-kind="conflict"] { --a-log-c: var(--a-attn); }
.a-log__entry[data-kind="check"] { --a-log-c: var(--a-ok); }
.a-log__entry[data-kind="error"] { --a-log-c: var(--a-attn); }
.a-log__entry[data-kind="conflict"] .a-log__glyph { border-radius: 3px; transform: rotate(45deg) scale(.85); }
.a-log__entry[data-kind="conflict"] .a-log__glyph > * { transform: rotate(-45deg); }
.a-log__text { min-width: 0; line-height: 1.4; }
.a-log__text small { display: block; font-size: var(--a-fs-sm); color: var(--fg-2); }
.a-log__side { display: flex; align-items: center; gap: .5rem; padding-top: .05rem; }
@media (max-width: 599.98px) {
  .a-log__entry { grid-template-columns: 1.5rem minmax(0, 1fr); row-gap: .2rem; }
  .a-log__time { grid-column: 2; grid-row: 2; padding: 0; }
  .a-log__glyph { grid-row: 1; }
  .a-log__side { grid-column: 2; }
}

/* ---- Storno-Regeln als Zeitleiste vor der Anreise ----------------------------------------
   <div class="a-policy">
     <div class="a-policy__bar">
       <span class="a-policy__band" data-fee="0" style="--w:60"><b>kostenlos</b><small>bis 15 Tage vorher</small></span>
       <span class="a-policy__band" data-fee="50" style="--w:28"><b>50 %</b><small>14–3 Tage</small></span>
       <span class="a-policy__band" data-fee="90" style="--w:12"><b>90 %</b><small>&lt; 3 Tage</small></span>
       <span class="a-policy__now" style="--x:93%">Heute</span>
     </div>
     <div class="a-policy__scale"><span>Buchung</span><span>Anreise</span></div>
   </div>                                                                                   */
.a-policy { position: relative; min-width: 0; }
.a-policy__bar { position: relative; display: flex; gap: 2px; padding-top: 1.7rem; }
.a-policy__band {
  --a-pol-bg: var(--a-ok-soft);
  --a-pol-fg: var(--a-ok);
  --a-pol-edge: var(--a-ok-fill);
  flex: var(--w, 1) 1 0;
  min-width: 0;
  display: grid;
  align-content: start;   /* bricht eine Stufe zweizeilig um, bleiben die anderen oben bündig */
  gap: .05rem;
  padding: .5rem .6rem .55rem;
  background: var(--a-pol-bg);
  box-shadow: inset 0 3px 0 var(--a-pol-edge);
  color: var(--a-pol-fg);
  font-size: var(--a-fs-xs);
  line-height: 1.3;
  overflow: hidden;
}
.a-policy__band:first-child { border-radius: 6px 0 0 6px; }
.a-policy__band:last-of-type { border-radius: 0 6px 6px 0; }
.a-policy__band b { font-size: var(--a-fs-sm); font-weight: 650; white-space: nowrap; }
/* schmale Stufe: lieber zwei Zeilen als „ab 2 Tagen vo…“ (die Formulierung ist überall dieselbe, Regel 10) */
.a-policy__band small { color: var(--fg-2); font-size: var(--a-fs-xs); line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.a-policy__band[data-fee="50"] { --a-pol-bg: var(--a-due-soft); --a-pol-fg: var(--a-due); --a-pol-edge: var(--a-due-fill); }
.a-policy__band[data-fee="90"], .a-policy__band[data-fee="100"] { --a-pol-bg: var(--a-attn-soft); --a-pol-fg: var(--a-attn); --a-pol-edge: var(--a-attn-fill); }
.a-policy__now {   /* „Heute“ hängt am Faden über der Leiste */
  position: absolute;
  top: 0;
  left: var(--x, 50%);
  translate: -50% 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--a-fs-xs);
  font-weight: 650;
  color: var(--fg);
  white-space: nowrap;
  pointer-events: none;
}
/* Faden vom Wort bis zur Oberkante der Leiste, Knoten sitzt auf der Kante – nie über dem Text */
.a-policy__now::after {
  content: "";
  width: var(--a-thread-w);
  height: .5rem;
  background: var(--a-thread);
}
.a-policy__now::before {
  content: "";
  position: absolute;
  bottom: -4.5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--a-thread);
  box-shadow: 0 0 0 2px var(--a-surface);
}
.a-policy__scale { display: flex; justify-content: space-between; margin-top: .4rem; font-size: var(--a-fs-xs); color: var(--fg-2); }

@media (forced-colors: active) {
  .a-thread__step::before, .a-relations > li + li::before { background: CanvasText !important; }
  .a-thread__knot, .a-relations > li + li::after { forced-color-adjust: none; background: CanvasText; }
}

/* Touch: die verknüpften Etiketten (Nr. · Gast) sind Ziele – unsichtbar auf 44 px vergrößert, das Etikett bleibt zierlich */
@media (pointer: coarse) { a.a-relations__item { position: relative; } a.a-relations__item::after { content: ""; position: absolute; inset: -7px -2px; } }
