/* Overrides after app.css (fix package f2, owner decision 2026-11-24 in STATUS.md).
   Only two deviations from the Stitch look, both forced by binding rules:
   1. Touch targets (QA M1): every tap target gets a hit area of at least 44 x 44 px. The visible shape
      stays the same: an invisible ::after layer centred on the element extends the hit area.
   2. Mandatory notices (QA M2): "Richtwert", the model notice, stop list and health notices at least 13 px.
   Plus the small components f2 added (demo banner, notices). No colour or layout changes otherwise. */

/* ---------- 1. Hit areas (M1) ---------- */
/* :where() keeps specificity at zero, so absolute/fixed/sticky utility classes still win. */
:where(.f2-hit, #app button, #app a[href], #app [role="button"], #app [role="switch"], #app [role="radio"],
  #app [role="checkbox"], #app [role="tab"]) {
  position: relative;
}

.f2-hit::after,
#app button::after,
#app a[href]::after,
#app [role="button"]::after,
#app [role="switch"]::after,
#app [role="radio"]::after,
#app [role="checkbox"]::after,
#app [role="tab"]::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
  background: transparent;
  pointer-events: auto;
}

/* Inputs cannot carry ::after; the manual-entry fields in Daten sit in an invisible wrapping label. */
.f2-input-hit {
  display: inline-flex;
  align-items: center;
}

/* Chip rows whose chips are 30-32 px high: the extra hit area needs free space above and below, otherwise
   the neighbouring content (painted later) covers it. A few px more spacing; the chips look the same. */
html[data-screen="13_fortschritt"] #app .flex-wrap.items-center.gap-space-xs > button,
html[data-screen="19_daten"] #app .flex-wrap.gap-space-xs > button {
  margin-block: 7px;
}

/* ---------- 2. Mandatory notices (M2) ---------- */
/* Set by components/notices.js only on mandatory texts rendered below 13 px. */
#app .f2-mandatory,
.f2-mandatory {
  font-size: 13px;
  line-height: 1.35;
}

.f2-notice {
  font-size: 15px;
  line-height: 1.45;
}

/* ---------- Demo banner (S1-04) ---------- */
.f2-demo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgb(var(--st-c-reiz-clay-subtle, 248 232 224));
  color: rgb(var(--st-c-on-surface, 28 34 30));
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.f2-demo-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgb(var(--st-c-reiz-clay, 201 115 84));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.f2-demo-text {
  flex: 1 1 200px;
}

.f2-demo-end {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgb(var(--st-c-outline-variant, 194 200 196));
  background: #fff;
  color: rgb(var(--st-c-primary, 65 99 82));
  font-weight: 600;
  font-size: 15px;
}

/* ---------- QA L6: endless pulse dots stop under reduced motion (system setting or in-app switch) ---------- */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse,
  .animate-ping {
    animation: none;
  }
}

html[data-reduce-motion="1"] .animate-pulse,
html[data-reduce-motion="1"] .animate-ping {
  animation: none;
}

/* ---------- f4 (QA q3 M1, M2): small layout fixes, Stitch look unchanged ---------- */
/* M1: the exercise name next to the "RPE 5-7" pill may shrink and break inside long words, so the pill (one line,
   shrink-0) never pushes the card past 375 px. */
html[data-screen="03_training"] #app section > div.flex.items-start.justify-between > div:first-child {
  min-width: 0;
}
html[data-screen="03_training"] #app section > div.flex.items-start.justify-between h2 {
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* M2: role="link" targets (made by dom.js makeButton) get the same invisible 44 px hit layer as buttons. */
:where(#app [role="link"]) {
  position: relative;
}
#app [role="link"]::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
  background: transparent;
  pointer-events: auto;
}

/* M2: back link "Mehr" under the sticky header: 44 px tall, so its hit area never reaches under the header. */
#app a.f4-back {
  min-height: 44px;
  align-items: center;
}

/* M2: rows of small pills (coach context chips 27 px, quick questions 30 px, gap-question answers): enough space
   between the rows that the 44 px hit areas of two rows do not overlap. Column spacing and pills unchanged. */
html[data-screen="18_coach_gespraech"] #app [role="group"].flex-wrap,
html[data-screen="18_coach_gespraech"] #app [role="list"].flex-wrap {
  row-gap: 18px;
  padding-block: 9px;
}
#app [data-hint] .flex.flex-col.items-start > button {
  min-height: 44px;
}

/* M2: the coach message field is 44 px tall (inputs cannot carry an ::after hit layer). */
#app #coach-message-input {
  min-height: 44px;
}
