/* ============================================================
   Buttons — .pb-btn + variants
   ------------------------------------------------------------
   One base class, layered with a single variant and (optionally)
   a single size + the .pb-btn-block modifier. The look is the
   calm, comfortable Pingbook button: near-black primary, quiet
   secondary/ghost neutrals, generous-but-tight padding, and a
   barely-there press (translateY). Everything is token-driven —
   no hard-coded colours, radii, spacing or shadows.

   Compose like:
     <button class="pb-btn pb-btn-primary">Anfrage senden</button>
     <button class="pb-btn pb-btn-secondary pb-btn-sm">Mehr</button>
     <button class="pb-btn pb-btn-icon" aria-label="Schließen">…</button>
   ============================================================ */

/* ---- Base ---- */
.pb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;

  /* min-height statt Padding-Arithmetik — dieselbe Überlegung wie im
     Handy-Block unten: sonst ist ein Knopf MIT Icon höher als einer
     ohne (das Icon ist grösser als die Zeile), und die Reihe steht
     uneben. 2rem = 28px; vorher waren es 21px ohne und 26px mit Icon. */
  min-height: 2rem;
  padding: 0.3125rem 0.8125rem;
  border-radius: var(--r-xs);
  border: none;
  gap: 0.375rem;

  color: var(--text);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

/* Icons sit at a tight 0.9375rem — matches the approved compact buttons. */
.pb-btn pb-icon { line-height: 0; }
.pb-btn svg { width: 15px; height: 15px; }

/* Subtle press feedback — feels physical, never bouncy. */
.pb-btn:active { transform: translateY(0.03125rem); }

/* ---- Variant · primary (filled, near-black) ---- */
.pb-btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}
/* Warn-Variante — der CTA im Sperr-Kontext (Sperr-Panel im Talent-
   Fenster, Tarif-Gates der Profil-Dialoge): Warnfarbe statt Primär-
   Schwarz, er gehört sichtbar zum Schloss-Kontext. Schrift auf
   --surface, NICHT #fff: --warn kippt zwischen den Themes (hell
   dunkelbraun, dunkel hellorange), --surface kippt gegenläufig mit. */
.pb-btn-warn {
  background: var(--warn);
  color: var(--surface);
}
.pb-btn-warn:hover { background: color-mix(in srgb, #000 12%, var(--warn)); }
.pb-btn-primary:hover { background: var(--primary-hover); }

/* ---- Variant · secondary (quiet filled chip — borderless) ---- */
.pb-btn-secondary {
  background: var(--surface-warm);
  color: var(--text);
}
.pb-btn-secondary:hover {
  background: color-mix(in srgb, var(--text) 8%, var(--surface-warm));
}

/* ---- Variant · ghost (no chrome until hovered) ---- */
.pb-btn-ghost {
  background: transparent;
  color: var(--text-soft);
}
.pb-btn-ghost:hover {
  background: var(--surface-warm);
  color: var(--text);
}

/* ---- Variant · icon (square, secondary-styled chip) ---- */
.pb-btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: var(--surface-warm);
  color: var(--text);
}
.pb-btn-icon:hover {
  background: color-mix(in srgb, var(--text) 8%, var(--surface-warm));
}
.pb-btn-icon svg { width: 16px; height: 16px; }

/* ---- Sizes ----
   The approved design renders all buttons at one compact size, so
   sm / lg are kept for semantics but resolve to the same metrics. */
.pb-btn-sm {
  min-height: 2rem;
  padding: 0.3125rem 0.8125rem;
  font-size: var(--fs-md);
  border-radius: var(--r-xs);
}
.pb-btn-sm svg { width: 15px; height: 15px; }

/* ---- Size · lg — the CTA size (reference: the "Weiter" button in the
   selection bar). Display font, 800, 2.25rem tall — use it for form and
   modal CTAs: Anmelden / Konto erstellen / Abbrechen / "150 Credits für
   120 €" and the Weiter button itself.

   Auf groben Zeigern hebt base.css die Höhe wieder auf 44px (--touch) —
   die Empfehlung fürs Touch-Ziel gilt unabhängig davon, wie ruhig der
   Knopf auf dem Desktop sein soll. ---- */
.pb-btn-lg {
  height: 2.25rem;
  padding: 0 1.125rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-body);
  letter-spacing: var(--track-body);
  border-radius: var(--r-md);
  gap: 0.4375rem;
}
/* Icon in em statt px: läuft mit der Schrift und endet optisch auf der
   Versal-Höhe der 800er-Diatype — 18px standen neben den 14px Text zu
   gross und rutschten optisch aus der Zeile.
   Negative Ränder = optischer Ausgleich: das 24er-Grid trägt Luft im
   viewBox — links zog das Knopf-Padding dadurch sichtbar auf, und die
   geometrische Flex-Mitte liess die Glyphe einen Hauch zu tief stehen. */
.pb-btn-lg svg {
  width: 1.125em;
  height: 1.125em;
  margin: -0.09em 0 0 -0.1875em;
}

/* ---- Size · go — der Knopf aller Fenster (Design „Neu“ #7, 01.10.2026).
   Vorbild ist „Weiter“ in der Auswahlleiste: 2.5rem hoch, Diatype 800,
   Radius r-xl − 0.5rem. Der Nebenweg (.pb-btn-secondary) ist hier eine
   Tinten-Tönung statt --surface-warm: sie trägt auf dem Seitengrund und
   im Fenster gleich (#31). Hauptweg bleibt .pb-btn-primary (dunkel).
   Compose: <button class="pb-btn pb-btn-go pb-btn-primary">Weiter</button> ---- */
.pb-btn-go {
  height: 2.5rem;
  padding: 0 1.125rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-body);
  letter-spacing: var(--track-body);
  border-radius: calc(var(--r-xl) - 0.5rem);
  gap: 0.4375rem;
}
.pb-btn-go.pb-btn-secondary { background: rgb(var(--tint) / 0.075); color: var(--text-soft); }
.pb-btn-go.pb-btn-secondary:hover { background: rgb(var(--tint) / 0.12); color: var(--text); }
.pb-btn-go svg { width: 1.125em; height: 1.125em; }

/* ---- Modifiers ---- */
.pb-btn-block { width: 100%; }

/* "Add to selection" button — same compact metrics as every button. */
.pb-btn-add { gap: 0.375rem; padding: 0.3125rem 0.8125rem; }
.pb-btn-add svg { width: 15px; height: 15px; }

/* ---- Disabled (native :disabled or aria-disabled) ----
   .loading ist ausgenommen: die Lade-Buttons setzen disabled nur gegen
   Doppelklicks — der Knopf soll dabei seine Farbe BEHALTEN (Label weg,
   Spinner drauf, s. unten), nicht als „gesperrt" ausgrauen. */
.pb-btn:disabled:not(.loading),
.pb-btn[aria-disabled="true"]:not(.loading) {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Coarse pointers (touch) skip the press nudge — it reads as a jitter. */
@media (hover: none) {
  .pb-btn:active { transform: none; }
}

/* ============================================================
   Handy — Knopfmaße von osmo.supply
   ------------------------------------------------------------
   Dort ist ein Knopf mit Beschriftung 33px hoch: Schrift 0.9375em,
   0.5em Innenabstand links/rechts, 0.25em Abstand zum Icon. Der
   Desktop-Knopf hier ist mit ~23px deutlich kompakter — auf dem
   Handy ist Osmos Grösse die angenehmere.

   Icon-Knöpfe bleiben mit 1.75em optisch klein (Osmo: 27px), die
   Trefferfläche wächst aber per Pseudo-Element auf 44px. Sichtbare
   Grösse und Touch-Ziel sind zwei verschiedene Dinge — so bleibt
   das Bild wie auf Osmo, ohne dass man danebentippt.
   ============================================================ */
@media (max-width: 767.98px) {
  .pb-btn {
    font-size: var(--fs-md);
    /* 2.15rem = 33px bei 375px — Osmos Knopfhöhe. rem, nicht em:
       der Knopf setzt seine Schrift auf 0.9375em herunter, ein
       em-Wert würde sich darauf beziehen und 31px ergeben.
       min-height statt Padding, damit die Höhe unabhängig davon
       stimmt, ob ein Icon im Knopf steckt. */
    min-height: 2.15rem;
    padding: 0.35em 0.5em;
    gap: 0.25em;
  }
  .pb-btn svg { width: 1em; height: 1em; }
  .pb-btn-sm { font-size: var(--fs-md); min-height: 2.15rem; padding: 0.35em 0.5em; }

  .pb-btn-icon {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    position: relative;
  }
  .pb-btn-icon svg { width: 1em; height: 1em; }
  .pb-btn-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--touch);
    height: var(--touch);
    transform: translate(-50%, -50%);
  }
}

/* ============================================================
   Schliessen-Knopf als EIN Primitive
   ------------------------------------------------------------
   Ersetzt die früheren Duplikate .sm-x/.rqm-x/.ck-x/.rqp-x
   (gelöscht); .am-x/.sf-x/.crd-x tragen nur noch ihre absolute
   Verankerung und kombinieren im Markup mit .pb-btn-x.
   Bewusst eigenständig geblieben: .td2-x (Glas-Chrome auf der
   Bildfläche, 2.125rem) und .pbc-pk-x (rotiertes Plus, 2rem).
   Touch-Ziel auf Coarse-Pointern: base.css hebt .pb-btn-x auf 44px.
   ============================================================ */
.pb-btn-x {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border: none;
  background: transparent;
  color: var(--text-faint);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pb-btn-x:hover { background: var(--surface-2); color: var(--text); }
.pb-btn-x svg { width: 18px; height: 18px; }

/* ============================================================
   Spinner-Primitive — currentColor-Ring, drei Grössen.
   Ersetzt die Ad-hoc-Spinner (.am-submit, .pb-ai-spin) durch
   EIN Element: <span class="pb-spin"></span>
   ============================================================ */
/* Seit 01.10.2026 (Design „Neu“ #16) dicker und mit runden Enden: die
   Kontur ist nur noch die leise Spur, der Bogen ist eine SVG-Maske mit
   stroke-linecap: round auf ::after — eine Rand-Ecke (border-top-color)
   kann keine runden Enden. */
.pb-spin {
  --spin: 1.125rem;
  --spin-w: 0.1875rem;
  position: relative;
  width: var(--spin);
  height: var(--spin);
  flex: none;
  border-radius: 50%;
  border: var(--spin-w) solid color-mix(in srgb, currentColor 16%, transparent);
  animation: pb-spin 0.7s linear infinite;
}
.pb-spin::after {
  content: "";
  position: absolute;
  inset: calc(var(--spin-w) * -1);
  border-radius: 50%;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-dasharray='24 100'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-dasharray='24 100'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.pb-spin.sm { --spin: 0.875rem; --spin-w: 0.15625rem; }
.pb-spin.lg { --spin: 1.5rem; }
@keyframes pb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .pb-spin { animation-duration: 1.6s; }
}

/* ============================================================
   Button-Loading für ALLE .pb-btn — das Muster von
   .am-submit.loading, generalisiert: Label wird transparent
   (Breite bleibt stehen), Spinner zentriert.
   Markup: btn.classList.add("loading")
   ============================================================ */
.pb-btn.loading {
  pointer-events: none;
  color: transparent !important;
  position: relative;
}
.pb-btn.loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border-radius: 50%;
  /* Bogen mit runden Enden wie .pb-spin (ohne Spur — der Knopf ist die Fläche) */
  background: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke='black' stroke-width='4.5' stroke-linecap='round' stroke-dasharray='24 100'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke='black' stroke-width='4.5' stroke-linecap='round' stroke-dasharray='24 100'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  animation: pb-spin 0.7s linear infinite;
}
.pb-btn-primary.loading::after { background: var(--primary-text); }

/* ============================================================
   Skeleton-Primitive — aus .n-skel (notifications.css)
   generalisiert. Bausteine, keine fertigen Layouts:
     <i class="pb-skel" style="width:60%;height:.625rem"></i>
   Grundsatz: Skeletons für Flächen mit bekannter Form (Feed,
   Listen, Panels), Spinner nur für kleine/inline Momente
   (Buttons, Felder, Nachladen).
   ============================================================ */
.pb-skel {
  display: block;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  animation: pb-skel 1.1s ease-in-out infinite;
}
.pb-skel--box { border-radius: var(--r-md); }
.pb-skel--circle { border-radius: 50%; }
@keyframes pb-skel { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .pb-skel { animation: none; opacity: 0.4; }
}

/* Talent-Karten-Skeleton fürs Grid (statt leerem Feed beim ersten
   Laden / Filterwechsel). Markup:
   <div class="pb-fcard-skel">
     <i class="pb-skel pb-skel--box" style="height:3.25rem"></i>
     <i class="pb-skel pb-skel--circle" style="width:2.5rem;height:2.5rem;margin-top:-1.6rem;margin-left:.5rem;box-shadow:0 0 0 .1875rem var(--surface)"></i>
     <i class="pb-skel" style="height:.8125rem;width:55%"></i>
     <i class="pb-skel" style="height:.625rem;width:35%"></i>
     <i class="pb-skel" style="height:1.5rem;width:80%;border-radius:var(--r-pill)"></i>
   </div> */
.pb-fcard-skel {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: var(--sp-2);
  background: var(--surface);
  border-radius: var(--r-lg);
  min-height: 15rem;
}
.pb-fcard-skel > .pb-skel--circle { position: relative; z-index: 1; }

/* ============================================================
   Schloss-Pille (.pb-lockcta) — das app-weite Zeichen für „hinter
   einem Tarif". Orange auf getöntem Grund, Schloss + Wort.
   Seit 01.10.2026 (Design „Neu“ #44/#47/#48) Vollpille in der
   Grundschrift (.8125rem/600) statt Mono-Versalien.
   ------------------------------------------------------------
   Als <span> ein Zustands-Badge, als <button>/<a> der Weg zum Tarif.
   Bis 25.08. lag das Muster nur als .td2-lockpill im Talent-Fenster;
   seit die Einstellungen dieselbe Sprache sprechen (SMS, Provision),
   steht es hier — .td2-lockpill nutzt es mit.
   ============================================================ */
.pb-lockcta {
  display: inline-flex;
  align-items: center;
  /* Abstand Schloss<->Wort halbiert; rechteckig mit runden Ecken
     statt Vollpille (20.08., Mathias). Vertikal symmetrisch: seit die
     Pille Versalien traegt, gibt es keine Unterlaengen mehr. */
  gap: 0.3125rem;
  padding: 0.1875rem 0.625rem 0.1875rem 0.5rem;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--warn-tint);
  color: var(--warn);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: baseline;
  text-decoration: none;
}
.pb-lockcta svg { width: 12px; height: 12px; flex: none; color: var(--warn); }
button.pb-lockcta,
a.pb-lockcta { cursor: pointer; }

/* ---- Gesperrter Knopf (.pb-btn.is-locked) ----
   Ein deaktivierter Knopf, der hinter einem Tarif liegt, spricht die
   Schloss-Sprache (warn-Familie) statt gedimmt „kaputt" auszusehen:
   Schloss-Icon vor dem Label, orange auf getönter Fläche. Genutzt vom
   Checkout-Submit (rqp-submit) und dem Aufladen-Knopf (Mitgliedschaft). */
.pb-btn.is-locked:disabled {
  opacity: 1;
  background: var(--warn-tint);
  color: var(--warn);
  cursor: default;
}
.pb-btn.is-locked:disabled:hover { background: var(--warn-tint); }
.pb-btn.is-locked svg { width: 13px; height: 13px; flex: none; }
/* Hover wie im Talent-Fenster seit 20.08.: die Pille dunkelt leicht,
   statt die Tönung zu wechseln. */
button.pb-lockcta:hover,
a.pb-lockcta:hover { filter: brightness(0.97); }
