/* ==========================================================================
   labels.css – Status, Zähler, Kanal-Etiketten, Merkmale, Wartezeit, Veränderung

   Status-Pille   <span class="a-pill a-pill--ok">Bezahlt</span>
                  ok · due · attn · info · neutral · draft  (+ --solid, --sm)
                  Jede Stufe hat ihre eigene FORM (Punkt · Halbkreis · Raute · Ring) –
                  nie nur Farbe.
   Zähler         <span class="a-badge a-badge--attn">3</span> (+ --due --ok --neutral --outline)
   Kanal          <span class="a-ch a-ch--booking"><span class="a-ch__mark" aria-hidden="true">B</span>
                  <span class="a-ch__name">Booking.com</span></span>
                  website · booking · airbnb · other  (+ --mark: nur Kürzel, Name bleibt für
                  Screenreader; --on-fill: auf gefülltem Belegungsbalken)
   Merkmal        <span class="a-tag"><span class="a-ico a-ico--hund"></span>Hund</span> (+ --outline --quiet)
   Wartezeit      <span class="a-wait" data-level="calm|due|attn">…</span> (< 4 h · ab 4 h · ab 24 h)
   Veränderung    <span class="a-delta a-delta--up a-delta--good">+12 %</span>
                  --up/--down/--flat × --good/--bad (Farbe = Richtung × ob gut)
   ========================================================================== */

/* ---- Status-Pille -------------------------------------------------------------------- */
.a-pill {
  --a-pill-fg: var(--a-neutral);
  --a-pill-bg: var(--a-neutral-soft);
  --a-pill-mark: var(--a-neutral-fill);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex: none;
  height: 1.375rem;                 /* 22 */
  padding: 0 .55rem 0 .45rem;
  border-radius: var(--r-pill);
  background: var(--a-pill-bg);
  color: var(--a-pill-fg);
  font-size: var(--a-fs-xs);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  vertical-align: middle;
}
.a-pill::before {   /* Form-Zeichen */
  content: "";
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--a-pill-mark);
}
.a-pill--ok { --a-pill-fg: var(--a-ok); --a-pill-bg: var(--a-ok-soft); --a-pill-mark: var(--a-ok-fill); }
.a-pill--due { --a-pill-fg: var(--a-due); --a-pill-bg: var(--a-due-soft); --a-pill-mark: var(--a-due-fill); }
.a-pill--due::before {   /* halb gefüllt = „bald“ */
  background: conic-gradient(var(--a-pill-mark) 0 50%, transparent 0);
  box-shadow: inset 0 0 0 1.5px var(--a-pill-mark);
}
.a-pill--attn { --a-pill-fg: var(--a-attn); --a-pill-bg: var(--a-attn-soft); --a-pill-mark: var(--a-attn-fill); }
.a-pill--attn::before { border-radius: 1px; width: .45rem; height: .45rem; transform: rotate(45deg); }   /* Raute */
.a-pill--info { --a-pill-fg: var(--a-info); --a-pill-bg: var(--a-info-soft); --a-pill-mark: var(--a-info-fill); }
.a-pill--info::before { background: transparent; box-shadow: inset 0 0 0 2px var(--a-pill-mark); }      /* Ring */
.a-pill--neutral::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--a-pill-mark); }
.a-pill--draft { --a-pill-bg: transparent; box-shadow: inset 0 0 0 1px var(--a-line-3); }
.a-pill--draft::before { background: transparent; border: 1.5px dashed var(--a-neutral-fill); width: .55rem; height: .55rem; }
/* gefüllt: nur für die eine Stelle, die auffallen MUSS (Konflikt, überfällig) */
.a-pill--solid { --a-pill-bg: var(--a-pill-mark); --a-pill-fg: var(--a-on-fill); }
.a-pill--solid::before { background: var(--a-on-fill); box-shadow: none; }
.a-pill--solid.a-pill--due { --a-pill-fg: var(--a-on-due); }
.a-pill--solid.a-pill--due::before { background: conic-gradient(var(--a-on-due) 0 50%, transparent 0); box-shadow: inset 0 0 0 1.5px var(--a-on-due); }
.a-pill--sm { height: 1.125rem; padding: 0 .45rem 0 .35rem; font-size: var(--a-fs-2xs); gap: .3rem; }
.a-pill--sm::before { width: .4rem; height: .4rem; }
.a-pill--plain { --a-pill-bg: transparent; padding-inline: 0; }   /* ohne Fläche (in dichten Listen) */

/* ---- Zähler ------------------------------------------------------------------------------ */
.a-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 .375rem;
  border-radius: var(--r-pill);
  background: var(--a-sunken);
  color: var(--fg-2);
  font-size: var(--a-fs-xs);
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  vertical-align: middle;
}
.a-badge--attn { background: var(--a-attn-fill); color: var(--a-on-fill); }
.a-badge--due { background: var(--a-due-fill); color: var(--a-on-due); }
.a-badge--ok { background: var(--a-ok-fill); color: var(--a-on-fill); }
.a-badge--info { background: var(--a-info-fill); color: var(--c-paper); }
[data-theme="abend"] .a-badge--info { color: var(--c-ink); }
.a-badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--a-line-3); }

/* ---- Kanal-Etikett (gewebt, mit Kürzel) --------------------------------------------------- */
.a-ch {
  --a-ch-c: var(--a-ch-other);
  --a-ch-t: var(--a-ch-other-text);
  --a-ch-s: var(--a-ch-other-soft);
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex: none;
  max-width: 100%;
  font-size: var(--a-fs-sm);
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  vertical-align: middle;
}
.a-ch--other { --a-ch-c: var(--a-ch-other); --a-ch-t: var(--a-ch-other-text); --a-ch-s: var(--a-ch-other-soft); }
.a-ch--website { --a-ch-c: var(--a-ch-website); --a-ch-t: var(--a-ch-website-text); --a-ch-s: var(--a-ch-website-soft); }
.a-ch--booking { --a-ch-c: var(--a-ch-booking); --a-ch-t: var(--a-ch-booking-text); --a-ch-s: var(--a-ch-booking-soft); }
.a-ch--airbnb { --a-ch-c: var(--a-ch-airbnb); --a-ch-t: var(--a-ch-airbnb-text); --a-ch-s: var(--a-ch-airbnb-soft); }
/* Das gewebte Kürzel: Tönung + Köper, eingekerbte Enden, Stiche in Kanalfarbe */
.a-ch__mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 1.75rem;
  height: 1.25rem;
  padding: 0 .55rem;
  background-color: var(--a-ch-s);
  background-image: var(--a-twill);
  color: var(--a-ch-t);
  font-family: var(--font-sans);
  font-size: var(--a-fs-2xs);
  font-weight: 700;
  font-stretch: 85%;
  font-variation-settings: "wdth" 85;
  letter-spacing: .06em;
  line-height: 1;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 50%, 100% 100%, 0 100%, 3px 50%);
}
.a-ch__mark::before, .a-ch__mark::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 1px;
  background-image: repeating-linear-gradient(to bottom, var(--a-ch-c) 0 2px, transparent 2px 4px);
  opacity: .85;
}
.a-ch__mark::before { left: 5px; }
.a-ch__mark::after { right: 5px; }
.a-ch__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* nur Kürzel (dichte Tabellen, Belegung) – Name bleibt für Screenreader */
.a-ch--mark .a-ch__name {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* auf gefülltem Belegungsbalken (Kanal-Fläche): helles Etikett */
.a-ch--on-fill .a-ch__mark {
  background-color: rgb(245 239 228 / .92);
}
[data-theme="abend"] .a-ch--on-fill .a-ch__mark { background-color: rgb(30 26 23 / .6); }
.a-ch--sm .a-ch__mark { min-width: 1.4rem; height: 1rem; padding: 0 .4rem; font-size: .625rem; }
.a-ch--sm .a-ch__mark::before { left: 4px; top: 2px; bottom: 2px; }
.a-ch--sm .a-ch__mark::after { right: 4px; top: 2px; bottom: 2px; }
/* Farbpunkt für Legenden & Listen (ergänzend zum Kürzel) */
.a-ch__dot { width: .5rem; height: .5rem; border-radius: 2px; background: var(--a-ch-c); flex: none; }

/* ---- Merkmal (Hund, glutenfrei, Stammgast, Quelle) ------------------------------------- */
.a-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: none;
  height: 1.375rem;
  padding: 0 .5rem;
  border-radius: var(--a-r-sm);
  background: var(--a-surface-2);
  color: var(--fg-2);
  font-size: var(--a-fs-xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.a-tag .a-ico { width: .875rem; height: .875rem; }
.a-tag--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--a-line-2); }
.a-tag--quiet { background: transparent; padding: 0; height: auto; }
.a-tag--strong { color: var(--fg); font-weight: 600; }
.a-tags { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---- Wartezeit (Anfragen): ruhig < 4 h · Senf ab 4 h · Krapp ab 24 h --------------------- */
.a-wait {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: var(--a-fs-xs);
  font-weight: 500;
  color: var(--fg-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}
.a-wait .a-ico { width: .875rem; height: .875rem; }
.a-wait[data-level="due"] { color: var(--a-due); font-weight: 600; }
.a-wait[data-level="attn"] { color: var(--a-attn); font-weight: 650; }

/* ---- Veränderung ------------------------------------------------------------------------- */
.a-delta {
  --a-delta-c: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--a-delta-c);
  font-size: var(--a-fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.a-delta::before {
  content: "";
  width: 0;
  height: 0;
  border-inline: .3em solid transparent;
}
.a-delta--up::before { border-bottom: .42em solid currentColor; margin-bottom: .1em; }
.a-delta--down::before { border-top: .42em solid currentColor; margin-top: .1em; }
.a-delta--flat::before { width: .6em; height: 1.5px; border: 0; background: currentColor; }
.a-delta--good { --a-delta-c: var(--a-ok); }
.a-delta--bad { --a-delta-c: var(--a-attn); }
.a-delta__ref { font-size: var(--a-fs-sm); font-weight: 400; color: var(--fg-2); margin-left: .15rem; }

@media (forced-colors: active) {
  .a-pill, .a-badge, .a-tag { border: 1px solid CanvasText; }
  .a-ch__mark { border: 1px solid CanvasText; clip-path: none; }
}
