/* Kinderpraxis – styles. System fonts only, no external resources. */
:root {
  --bg: #fdf6ec;
  --flaeche: #ffffff;
  --flaeche-2: #fff1dc;
  --tinte: #2a1f17;
  --tinte-2: #5a4a3c;
  --primaer: #1d6b58;
  --primaer-dunkel: #134d3f;
  --primaer-hell: #d9efe8;
  --akzent: #e7a13a;
  --akzent-hell: #fde8c4;
  --ok: #1d6b58;
  --ok-hell: #def3ea;
  --nochmal: #8a4b00;
  --nochmal-hell: #fff0d9;
  --rahmen: #e6d6c2;
  --fokus: #1f5fbf;
  --stern: #b86e00;
  --radius: 18px;
  --radius-klein: 12px;
  --schatten: 0 2px 0 rgba(42, 31, 23, .06), 0 8px 24px rgba(42, 31, 23, .08);
  --abstand: clamp(16px, 4vw, 28px);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tinte);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }
a { color: var(--primaer-dunkel); text-underline-offset: 3px; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 3px; border-radius: 8px; }
/* Headings receive programmatic focus on screen change (screen readers); never show a ring for that. */
h1:focus, h1:focus-visible { outline: none; }

.skip { position: absolute; left: 8px; top: -60px; background: var(--tinte); color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 10; min-height: 44px; }
.skip:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* demo notice (legal, static, always visible) */
.demo-banner { margin: 0; padding: 8px var(--abstand); background: #2a1f17; color: #fff8ec; font-size: .9rem; line-height: 1.4; text-align: center; }

/* header */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--abstand); background: var(--flaeche); border-bottom: 1px solid var(--rahmen);
  position: sticky; top: 0; z-index: 5;
}
.marke { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; font: inherit; font-weight: 800; font-size: 1.25rem; color: var(--primaer-dunkel); cursor: pointer; min-height: 48px; padding: 4px 8px; margin-left: -8px; border-radius: 12px; }
.marke-icon { font-size: 1.6rem; }
.kopf-sterne { font-weight: 800; color: var(--stern); background: var(--akzent-hell); border-radius: 999px; padding: 8px 16px; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }

main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: var(--abstand); }
.laden { text-align: center; padding: 20vh 0; color: var(--tinte-2); }
.kernsatz { display: inline-block; font-weight: 800; color: var(--primaer-dunkel); background: var(--primaer-hell); border-radius: var(--radius-klein); padding: 6px 12px; margin: -4px 0 10px; font-size: 1rem; }
.lead { font-size: 1.1rem; color: var(--tinte-2); max-width: 62ch; }
.klein { font-size: 1rem; color: var(--tinte-2); }

/* buttons */
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: var(--radius-klein);
  min-height: 48px; min-width: 48px; padding: 10px 20px; border: 2px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn.primaer { background: var(--primaer); color: #fff; box-shadow: 0 4px 0 var(--primaer-dunkel); }
.btn.primaer:hover { background: var(--primaer-dunkel); }
.btn.gross { min-height: 60px; font-size: 1.15rem; padding: 14px 28px; border-radius: 16px; }
.btn.sekundaer { background: var(--flaeche); color: var(--primaer-dunkel); border-color: var(--primaer); }
.btn.sekundaer:hover { background: var(--primaer-hell); }
.btn.leise { background: transparent; color: var(--tinte-2); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.btn.leise:hover { color: var(--tinte); background: rgba(0, 0, 0, .04); }
.btn:disabled { cursor: default; }
.aktionen { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 8px; }

/* cards */
.karte { background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 20px; margin: 16px 0; box-shadow: var(--schatten); }
.karte h2 { margin-bottom: .4em; }

/* start */
.hero { padding: 8px 0 4px; }
.hero-tiere { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-tiere img { width: 84%; height: 84%; object-fit: contain; }
.hero-tiere { flex-wrap: nowrap; }
.hero-tiere span { width: clamp(52px, 16vw, 72px); height: clamp(52px, 16vw, 72px); flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: color-mix(in srgb, var(--tierfarbe) 22%, #fff); border: 2px solid color-mix(in srgb, var(--tierfarbe) 55%, #fff); }
.hinweis-box { background: var(--akzent-hell); border-left: 6px solid var(--akzent); border-radius: var(--radius-klein); padding: 12px 16px; max-width: 62ch; }
.rang-name { font-size: 1.35rem; font-weight: 800; margin-bottom: .4em; }
.balken { height: 16px; background: var(--flaeche-2); border-radius: 999px; overflow: hidden; margin: 6px 0 12px; border: 1px solid var(--rahmen); }
.balken span { display: block; height: 100%; background: linear-gradient(90deg, var(--akzent), var(--stern)); border-radius: 999px; min-width: 6px; transition: width .6s ease; }
.segmente { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.btn.seg { flex: 1 1 110px; background: var(--flaeche); border-color: var(--rahmen); color: var(--tinte); }
.btn.seg[aria-pressed="true"] { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.so-gehts ol { margin: 0; padding-left: 1.4em; }
.so-gehts li { margin-bottom: .35em; }
.reset-zeile { text-align: center; margin-top: 8px; }

/* what makes it special (visible within 30 seconds) */
.usp { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.usp li { display: flex; gap: 10px; align-items: flex-start; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius-klein); padding: 8px 12px; font-size: .98rem; line-height: 1.4; }
.usp li > span:first-child { font-size: 1.4rem; line-height: 1.2; flex: none; }

/* steps */
.schritte { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; }
.schritte li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; color: var(--tinte-2); text-align: center; min-width: 0; }
.schritte .nr { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--flaeche); border: 2px solid var(--rahmen); font-weight: 800; font-size: .9rem; }
.schritte li.fertig .nr { background: var(--primaer-hell); border-color: var(--primaer); color: var(--primaer-dunkel); }
.schritte li.aktiv .nr { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.schritte li.aktiv { color: var(--tinte); font-weight: 700; }
.schritte .sname { white-space: nowrap; overflow-wrap: normal; }
.schritt-titel { display: none; margin: -10px 0 14px; font-weight: 700; color: var(--tinte-2); font-size: 1rem; text-align: center; }
@media (max-width: 640px) { .schritte .sname { display: none; } .schritt-titel { display: block; } }

/* animal picture */
.tierbild {
  --gr: 64px;
  position: relative; flex: none; width: var(--gr); height: var(--gr); border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff 0, color-mix(in srgb, var(--tierfarbe) 28%, #fff) 70%);
  border: 3px solid color-mix(in srgb, var(--tierfarbe) 60%, #fff);
}
.tierbild.gross { --gr: clamp(110px, 30vw, 150px); }
.tier-emoji { font-size: calc(var(--gr) * .58); line-height: 1; transition: transform .4s ease, filter .4s ease; }
.tier-status { position: absolute; right: -6px; top: -6px; font-size: calc(var(--gr) * .26); background: #fff; border-radius: 50%; width: calc(var(--gr) * .42); height: calc(var(--gr) * .42); display: grid; place-items: center; box-shadow: var(--schatten); }
.tier-foto { width: 86%; height: 86%; object-fit: contain; transition: transform .4s ease, filter .4s ease; user-select: none; -webkit-user-drag: none; }
.tierbild[data-zustand="krank"] .tier-emoji, .tierbild[data-zustand="krank"] .tier-foto { filter: saturate(.45) brightness(.97); transform: rotate(-8deg) translateY(4px); }
.tierbild[data-zustand="gesund"] .tier-emoji, .tierbild[data-zustand="gesund"] .tier-foto { animation: huepfen 1.4s ease-in-out 2; }
.tierbild[data-zustand="gesund"] { border-color: var(--ok); }
@keyframes huepfen { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-14%) rotate(-4deg); } 60% { transform: translateY(0) rotate(3deg); } }

.fall-buehne { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.fall-buehne > div:last-child { flex: 1 1 240px; min-width: 0; }
.patient-kopf { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.patient-name { font-size: 1.2rem; font-weight: 800; margin: 0; }
.patient-info { color: var(--tinte-2); margin: 0; }
.pfoten { letter-spacing: 2px; white-space: nowrap; }

.sprechblase { position: relative; margin: 8px 0 16px; background: var(--flaeche); border: 2px solid var(--rahmen); border-radius: 22px; padding: 18px 22px; font-size: 1.15rem; box-shadow: var(--schatten); }
.sprechblase p { margin: 0 0 6px; font-weight: 600; }
.sprechblase footer { font-size: 1rem; color: var(--tinte-2); }
.symptome { margin: 0; padding-left: 1.3em; }

/* examination */
.werkzeuge { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 16px 0; }
.werkzeug { background: var(--flaeche); border: 2px solid var(--rahmen); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.werkzeug.erledigt { border-color: color-mix(in srgb, var(--primaer) 45%, var(--rahmen)); }
.werkzeug.wichtig { border-color: var(--akzent); background: #fffaf0; }
.btn.werkzeug-btn { justify-content: flex-start; background: var(--flaeche-2); color: var(--tinte); min-height: 60px; text-align: left; width: 100%; }
.werkzeug.erledigt .werkzeug-btn { background: var(--primaer-hell); }
.wz-icon { font-size: 1.7rem; flex: none; }
.befund { margin: 0; padding: 4px 6px 2px; font-size: 1.02rem; }
.marke-wichtig { color: var(--nochmal); }
.zaehler { font-weight: 700; color: var(--tinte-2); }

/* choices */
.befunde summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.befunde ul { margin: 8px 0 0; padding-left: 0; list-style: none; }
.befunde li { padding: 6px 0; border-top: 1px dashed var(--rahmen); }
.optionen { display: grid; gap: 12px; margin: 18px 0; }
.btn.option { justify-content: flex-start; text-align: left; background: var(--flaeche); color: var(--tinte); border-color: var(--rahmen); min-height: 60px; font-size: 1.08rem; padding: 14px 18px; box-shadow: 0 3px 0 var(--rahmen); }
.btn.option:hover:not(:disabled) { border-color: var(--primaer); background: #fbfffd; }
.btn.option.daneben { background: #f4eee8; color: #6b5d50; text-decoration: line-through; text-decoration-color: rgba(107, 93, 80, .6); box-shadow: none; }
.btn.option.getroffen { background: var(--ok-hell); border-color: var(--ok); color: var(--primaer-dunkel); box-shadow: 0 3px 0 var(--ok); }
.btn.option.getroffen::before { content: "✓"; font-weight: 900; }
.btn.option:disabled:not(.getroffen):not(.daneben) { opacity: .7; }

.feedback { border-radius: var(--radius); padding: 16px 20px; margin: 8px 0 4px; border: 2px solid; animation: einblenden .25s ease; }
.feedback.ok { background: var(--ok-hell); border-color: var(--ok); }
.feedback.nochmal { background: var(--nochmal-hell); border-color: #d99a4a; }
.fb-titel { font-weight: 800; font-size: 1.15rem; }
.feedback p:last-child { margin-bottom: 0; }
@keyframes einblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* result */
.gross-sterne { font-size: 2.6rem; margin: 0; line-height: 1.1; }
.sterne { color: var(--stern); letter-spacing: 3px; white-space: nowrap; }
.lob { font-weight: 800; font-size: 1.15rem; margin: 4px 0 0; color: var(--primaer-dunkel); }
.kriterien { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kriterien li { font-weight: 700; font-size: .98rem; border-radius: 999px; padding: 6px 14px; display: inline-flex; gap: 6px; align-items: center; background: var(--akzent-hell); }
.kriterien li.ok .k-icon { color: var(--stern); }
.kriterien li.offen { background: #f1ebe4; }
.aktionen.oben { margin-top: 16px; }
.kriterien li.offen { color: var(--tinte-2); }
.tipp { background: var(--nochmal-hell); border-color: #e9c48f; }
.lernziel { background: var(--primaer-hell); border-radius: var(--radius-klein); padding: 10px 14px; margin: 0; }
.zuhause { background: #f3f8ff; border: 1px solid #c9dcf5; border-radius: var(--radius-klein); padding: 10px 14px; margin: 0; }
.tipp summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.tipp p:last-child { margin-bottom: 0; }
.start-aktionen { margin: 16px 0 6px; }
.btn.zweizeilig { flex-direction: column; gap: 2px; line-height: 1.2; }
.btn .unterzeile { font-size: .9rem; font-weight: 600; opacity: .92; }
/* keep the next step reachable on long result screens (phones) */
@media (max-width: 640px) {
  main[data-screen="ergebnis"] .aktionen.oben { position: sticky; bottom: 0; z-index: 4; margin: 16px calc(-1 * var(--abstand)) 0; padding: 10px var(--abstand) calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 94%, transparent); border-top: 1px solid var(--rahmen); }
}
.start-aktionen .btn.gross { flex: 1 1 100%; }
.start-aktionen .btn.sekundaer { flex: 1 1 140px; }
.tag-info { margin: 0 0 16px; }
.abnahme { margin: 8px 0 0; }
.abnahme a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.tag-badge { display: inline-block; background: var(--primaer); color: #fff; font-weight: 800; font-size: .95rem; border-radius: 999px; padding: 6px 14px; margin: 0 0 14px; }
.rekord { display: inline-block; background: var(--akzent-hell); border: 2px solid var(--akzent); border-radius: 999px; padding: 6px 16px; font-weight: 800; margin: 10px 0 0; }
.bilanz { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.bilanz li { display: flex; align-items: center; gap: 14px; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--schatten); }
.bilanz .b-name { flex: 1; min-width: 0; }
.bilanz .sterne { font-size: 1.3rem; }

/* waiting room + album */
.tiergruppe { margin: 26px 0 8px; }
.patienten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; margin-top: 10px; }
.patient-karte {
  font: inherit; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--flaeche); border: 2px solid color-mix(in srgb, var(--tierfarbe) 45%, var(--rahmen)); border-radius: var(--radius);
  padding: 14px 10px; min-height: 140px; color: var(--tinte); box-shadow: var(--schatten); transition: transform .12s ease;
}
.patient-karte:hover { transform: translateY(-2px); }
.pk-emoji { font-size: 2.4rem; line-height: 1.1; display: block; }
.pk-emoji .tier-foto { width: 84px; height: 84px; }
.pk-name { font-weight: 800; font-size: 1.1rem; }
.pk-neu { font-size: .95rem; color: var(--tinte-2); }
.patient-karte.geloest { background: color-mix(in srgb, var(--tierfarbe) 10%, #fff); }

.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; margin-top: 16px; }
.wkarte { background: var(--flaeche); border-radius: var(--radius); padding: 18px; border: 3px solid color-mix(in srgb, var(--tierfarbe) 60%, #fff); box-shadow: var(--schatten); position: relative; }
.wkarte.zu { background: repeating-linear-gradient(45deg, #faf3ea, #faf3ea 12px, #f4ebdf 12px, #f4ebdf 24px); border-color: var(--rahmen); color: var(--tinte-2); }
.wk-emoji { font-size: 2.2rem; margin: 0 0 4px; }
.wk-emoji .tier-foto { width: 72px; height: 72px; }
.wk-emoji.silhouette .tier-foto, .wk-emoji.silhouette .tier-emoji { filter: brightness(0); opacity: .18; }
.wkarte h2 { font-size: 1.1rem; }
.wkarte.neu { margin: 18px 0; background: linear-gradient(160deg, #fff, color-mix(in srgb, var(--tierfarbe) 14%, #fff)); }
.wk-label { display: inline-block; background: var(--akzent); color: var(--tinte); font-weight: 800; font-size: .9rem; border-radius: 999px; padding: 4px 12px; margin-bottom: 8px; }

/* footer + legal pages */
.fuss { background: #f5ead9; border-top: 1px solid var(--rahmen); padding: 10px var(--abstand) 18px; font-size: .95rem; color: var(--tinte-2); }
.fuss .hinweis { margin: 0; }
.fuss-links a { padding: 0 2px; }
.fuss > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.hinweis { margin-bottom: 10px; }
.fuss-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.fuss-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--tinte); }
.recht main { line-height: 1.6; }
.recht main h2 { margin-top: 1.4em; }
.recht main ul { padding-left: 1.3em; }
.recht table { border-collapse: collapse; width: 100%; font-size: 1rem; }
.recht td, .recht th { border-bottom: 1px solid var(--rahmen); padding: 8px 6px; text-align: left; vertical-align: top; }
.zurueck { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .aktionen .btn { flex: 1 1 100%; }
  .karte { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .kopf, .fuss-links, .aktionen, .skip { display: none; }
  body { background: #fff; }
}
