/* 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;
}

/* Owner order 2026-11-28: no zoom, no sideways scrolling. Vertical panning only; double-tap zoom is off with
   touch-action. Form fields are at least 16 px: iOS Safari zooms into any field below that when it is tapped. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
#app input,
#app textarea,
#app select,
[data-sheet] input,
[data-sheet] textarea,
[data-sheet] select {
  font-size: 16px;
}

/* Phone fix (owner screenshot 2026-11-28): in the five-norm rows (Heute, Plan) a long value such as
   "Zone 2, 60-75 %HFmax · Richtwert" touched its label. The label keeps its width, the value gets a gap,
   right-aligned wrapping and may shrink. Colours, sizes and fonts stay as in Stitch. */
[data-norm-row] {
  gap: 12px;
}
[data-norm-row] > :first-child {
  flex-shrink: 0;
}
[data-norm-row] > :last-child {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

/* 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;
}

/* ta2 c6 (Pate OT-8): a fixed date in onboarding step 2 shows its full name (up to 40 characters). The name wraps,
   the load badge moves under it when there is no room, "Entfernen" moves to its own line on narrow screens. */
#app [data-ext] {
  flex-wrap: wrap;
}
#app [data-ext] > .flex-col {
  flex: 1 1 9rem;
}
#app [data-ext] > .flex-col > div:first-child {
  flex-wrap: wrap;
  gap: 4px 8px;
}
#app [data-ext-name] {
  min-width: 0;
  overflow-wrap: anywhere;
}
#app [data-ext] > .flex-col > div:first-child > span:last-child {
  white-space: nowrap;
}
#app [data-ext] > button {
  margin-left: auto;
}
