*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Funnel Display', sans-serif;
  background: #F9EAD9;
}

/* Ruhiger Herzschlag (~55 bpm): Doppelschlag «lub-dub», danach Pause */
@keyframes heartbeat {
  0%   { transform: scale(1); }
  12%  { transform: scale(1.06); }
  22%  { transform: scale(0.99); }
  32%  { transform: scale(1.04); }
  48%  { transform: scale(1); }
  100% { transform: scale(1); }
}
@keyframes heartbeat-glow {
  0%, 48%, 100% { opacity: .65; }
  12%           { opacity: 1; }
  32%           { opacity: .9; }
}
.heartbeat      { animation: heartbeat 1.1s ease-in-out infinite; transform-origin: 50% 55%; }
.heartbeat-glow { animation: heartbeat-glow 1.1s ease-in-out infinite; }
@keyframes scroll-cue-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(10px); }
}
#scroll-cue { animation: scroll-cue-bob 1.8s ease-in-out infinite; }
/* Startseite: Herz-Figur schlägt und blinzelt ab und zu (Kreis – Strich – Kreis) */
.hero-heart { transform-box: fill-box; }
/* Startseite: das Herz pulsiert ruhig; ab und zu (unregelmässig) hüpft es
   kurz, der Schatten wird dabei kleiner und beim Landen wieder grösser */
.heartbeat.hero-heart {
  transform-box: fill-box;
  transform-origin: 50% 60%;
  animation: hero-pulse 1.2s ease-in-out infinite;
  animation-play-state: paused;
}
/* Pulsieren nur, wenn man mit der Maus über das Herz fährt */
.hero-wrap:hover .heartbeat.hero-heart,
#app.hero-hot .heartbeat.hero-heart { animation-play-state: running; }
#hero-title { transform-origin: 0% 50%; transition: transform 0.35s cubic-bezier(.3,1.4,.5,1); }
#app.hero-hot #hero-title { transform: scale(1.04); }
@keyframes hero-pulse {
  0%   { transform: scale(1); }
  12%  { transform: scale(1.06); }
  24%  { transform: scale(0.99); }
  36%  { transform: scale(1.04); }
  55%, 100% { transform: scale(1); }
}
.hero-jump {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: hero-jump 13s ease-in-out infinite;
}
/* zwei Hüpfer pro 13 s an unregelmässigen Stellen (bei ~2.3 s und ~9.4 s) */
@keyframes hero-jump {
  0%, 17%   { transform: translateY(0) scale(1, 1); }
  18%       { transform: translateY(0) scale(1.01, 0.99); }
  20.5%     { transform: translateY(-6%) scale(1, 1.005); }
  23%       { transform: translateY(0) scale(1.01, 0.99); }
  24.5%, 71% { transform: translateY(0) scale(1, 1); }
  72%       { transform: translateY(0) scale(1.01, 0.99); }
  74%       { transform: translateY(-4%) scale(1, 1.005); }
  76%       { transform: translateY(0) scale(1.01, 0.99); }
  77.5%, 100% { transform: translateY(0) scale(1, 1); }
}
.hero-shadow {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: hero-shadow 13s ease-in-out infinite;
}
@keyframes hero-shadow {
  0%, 17%    { transform: scale(1);    opacity: 0.7; }
  18%        { transform: scale(1.03); opacity: 0.75; }
  20.5%      { transform: scale(0.78); opacity: 0.45; }
  23%        { transform: scale(1.04); opacity: 0.75; }
  24.5%, 71% { transform: scale(1);    opacity: 0.7; }
  72%        { transform: scale(1.02); opacity: 0.72; }
  74%        { transform: scale(0.85); opacity: 0.5; }
  76%        { transform: scale(1.03); opacity: 0.74; }
  77.5%, 100% { transform: scale(1); opacity: 0.7; }
}
/* Blinzeln: harter Wechsel Kreis -> Strich -> Kreis (kein Morph).
   Pro 6 s: einmal früh einfach, später manchmal schnell zweimal hintereinander */
.eye-open, .eye-closed { animation-duration: 9s; animation-iteration-count: infinite; animation-timing-function: step-end; }
.eye-open   { animation-name: eye-open; }
.eye-closed { animation-name: eye-closed; opacity: 0; }
@keyframes eye-open {
  0%    { opacity: 1; }
  10%   { opacity: 0; }
  11.7% { opacity: 1; }
  66%   { opacity: 0; }
  67.4% { opacity: 1; }
  69.4% { opacity: 0; }
  70.8% { opacity: 1; }
}
@keyframes eye-closed {
  0%    { opacity: 0; }
  10%   { opacity: 1; }
  11.7% { opacity: 0; }
  66%   { opacity: 1; }
  67.4% { opacity: 0; }
  69.4% { opacity: 1; }
  70.8% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .heartbeat, .heartbeat-glow, #scroll-cue, .eye-open, .eye-closed, .hero-jump, .hero-shadow { animation: none; }
}

#viewport {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #F9EAD9; overflow: hidden;
}

#app {
  position: relative;
  width: 1482px; height: 853px;
  flex: none;
  transform-origin: center center;
  background: radial-gradient(125% 95% at 32% 42%, #FDF1E5 0%, #F9EAD9 55%, #F2DEC9 100%);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.12s ease;
}

/* ── Future-years slider: looks like age slider ── */
#future-slider, #m-future-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(to right, #2A6697 var(--slider-pct, 0%), #CDCDCD var(--slider-pct, 0%));
  cursor: pointer;
  outline: none;
  margin: 4px 0;
}
#future-slider::-webkit-slider-thumb, #m-future-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2A6697;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  cursor: pointer;
}
#future-slider::-moz-range-thumb, #m-future-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2A6697;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  cursor: pointer;
}
#future-slider::-moz-range-track, #m-future-slider::-moz-range-track {
  height: 14px;
  border-radius: 7px;
  background: #CDCDCD;
}

/* ── Nav transition ── */
nav a { transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease; }
nav a:hover { transform: translateY(-1px); }

/* ── Hide number input spinners ── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; outline: none; }

/* ── Input focus glow ── */
input[type=number]:focus {
  border-color: #2A6697 !important;
  box-shadow: 0 0 0 3px rgba(42,102,151,.14);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}


/* ── Toggle & gender/smoke button press pulse ── */
#btn-female, #btn-male, #btn-nein, #btn-ja,
#m-btn-female, #m-btn-male, #m-btn-nein, #m-btn-ja {
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, filter 0.15s ease;
}
#btn-female:active, #btn-male:active, #btn-nein:active, #btn-ja:active,
#m-btn-female:active, #m-btn-male:active, #m-btn-nein:active, #m-btn-ja:active { transform: scale(0.86); }

/* ── Keyboard focus ring (WCAG 2.4.7) ── */
:focus-visible {
  outline: 2px solid #2A6697;
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible {
  outline: 2px solid #2A6697;
  outline-offset: 2px;
}
a:focus-visible {
  outline: 2px solid #2A6697;
  outline-offset: 3px;
  border-radius: 6px;
}
[tabindex]:focus-visible {
  outline: 2px solid #2A6697;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Tun dropdown animation ── */
.tun-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.18s ease;
}

/* ──────────────── MOBILE (≤ 900px) ──────────────── */
#mobile { display: none; opacity: 0; transition: opacity 0.12s ease; }

@media (max-width: 900px) {
  html, body { overflow: auto; height: auto; }
  #viewport  { display: none !important; }
  #mobile    { display: block; min-height: 100vh;
               background: radial-gradient(125% 95% at 32% 42%, #FDF1E5 0%, #F9EAD9 55%, #F2DEC9 100%); }

  .m-header {
    position: sticky; top: 0; z-index: 100;
    padding: 14px 18px 10px;
    background: rgba(253,249,245,.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #EDE3D7;
  }
  .m-logo {
    display: flex; align-items: center; gap: 8px;
    font-family: 'Source Serif 4', serif; font-weight: 600;
    font-size: 17px; color: #232E38; text-decoration: none;
    margin-bottom: 10px; line-height: 1.1;
  }
  .m-nav {
    display: flex; gap: 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #FDF9F5;
    border-radius: 36px;
    padding: 4px;
    box-shadow: 0 1px 2px rgba(35,46,56,.05);
    width: fit-content; max-width: 100%;
  }
  .m-nav::-webkit-scrollbar { display: none; }
  .m-nav a {
    flex: 1 1 auto; text-align: center; padding: 8px 10px; border-radius: 26px;
    font-size: 14px; font-weight: 500; white-space: nowrap;
    text-decoration: none; color: #232E38; background: transparent;
    transition: background 0.15s, color 0.15s;
  }
  .m-main { padding: 14px 14px 48px; }
  .m-card {
    background: #FDF9F5; border-radius: 16px; padding: 16px;
    margin-bottom: 12px;
    box-shadow: inset 0 0 0 1px #fff, 0 1px 2px rgba(35,46,56,.04);
  }
  .m-section-title {
    font-family: 'Source Serif 4', serif; font-weight: 600;
    font-size: 15px; color: #2A6697; margin-bottom: 14px;
  }
  .m-field { margin-bottom: 14px; }
  .m-field:last-child { margin-bottom: 0; }
  .m-field-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
  }
  .m-field-label { font-weight: 600; font-size: 15px; color: #232E38; }
  .m-val-wrap { display: flex; align-items: baseline; gap: 4px; }
  .m-val-input {
    width: 48px; text-align: center; padding: 2px 4px;
    border: 1px solid #D8DFE3; border-radius: 6px;
    background: #FFFDFA; font-weight: 600; font-size: 15px;
    color: #232E38; cursor: text; font-family: inherit;
  }
  .m-val-unit { font-size: 12px; color: #787878; }
  .m-track {
    position: relative; height: 20px; border-radius: 10px;
    cursor: pointer; touch-action: none;
  }
  .m-thumb {
    position: absolute; top: 50%; width: 24px; height: 24px;
    border-radius: 50%; background: #fff; border: 2px solid #232E38;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transform: translate(-50%,-50%); pointer-events: none;
  }
  .m-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    border-radius: 10px; pointer-events: none;
  }
  .m-toggle {
    display: flex; height: 38px; border-radius: 20px;
    background: #FFFDFA; border: 1px solid #D8DFE3; overflow: hidden;
  }
  .m-toggle-btn {
    flex: 1; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 15px; font-weight: 500; border-radius: 20px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, filter 0.15s ease;
  }
  .m-toggle-btn:active { transform: scale(0.86); }
  .m-toggle { overflow: visible !important; }
  .m-card { transition: transform 0.1s ease; }
  .m-index-card { transition: background 0.15s ease, transform 0.1s ease !important; }
  .m-index-card:active { transform: scale(0.97) !important; }
  .m-tip { padding: 4px 18px 14px; }
  .m-info-box {
    font-family: "Funnel Display", sans-serif; font-weight: 700;
    font-size: 15px; line-height: 1.35; color: #232E38;
  }
  .m-info-box > div { padding: 0 !important; }
  .m-page-title {
    font-family: 'Source Serif 4', serif; font-weight: 600;
    font-size: 24px; color: #232E38; line-height: 1.15; margin-bottom: 4px;
  }
  .m-page-sub { font-size: 14px; color: #787878; margin-bottom: 10px; }
  .m-result-num {
    font-family: 'Source Serif 4', serif; font-weight: 600;
    font-size: 56px; line-height: 1; color: #232E38; margin-bottom: 4px;
  }
  .m-legend { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
  .m-legend-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #232E38; }
  .m-hearts-grid {
    display: grid; grid-template-columns: repeat(10,1fr); gap: 2px; margin: 10px 0;
  }
  .m-hearts-grid-mini {
    display: grid; grid-template-columns: repeat(10,1fr); gap: 1.5px;
  }
  .m-summary {
    font-size: 14px; color: #232E38; line-height: 1.45;
    padding: 12px 14px; border: 1px solid #EDE3D7; border-radius: 12px;
  }
  .m-bar-row { display: flex; gap: 10px; margin: 12px 0; }
  .m-bar-item {
    flex: 1; text-align: center; padding: 14px 10px;
    background: #F5EDE3; border-radius: 12px;
    border-left: 4px solid #CDCDCD;
  }
  .m-bar-label { font-size: 13px; margin-bottom: 4px; }
  .m-bar-val {
    font-family: 'Source Serif 4', serif;
    font-weight: 600; font-size: 30px; line-height: 1;
  }
  .m-footer { padding: 0 18px 28px; font-size: 14px; color: #94837a; }
  .m-footer a { color: #94837a; text-decoration: none; }
  /* index */
  .m-index-hero {
    text-align: center; padding: 36px 18px 20px;
    display: flex; flex-direction: column; align-items: center;
  }
  .m-index-title {
    font-family: 'Source Serif 4', serif; font-weight: 600;
    font-size: 34px; line-height: 1.1; color: #232E38; margin-top: 20px;
  }
  .m-index-cards { padding: 0 14px 48px; display: flex; flex-direction: column; gap: 10px; }
  .m-index-card {
    display: block; padding: 18px;
    background: #FDF9F5; border-radius: 16px; text-decoration: none;
    box-shadow: inset 0 0 0 1px #fff, 0 1px 2px rgba(35,46,56,.04);
    font-family: 'Source Serif 4', serif; font-weight: 600;
    font-size: 19px; color: #232E38; line-height: 1.25;
    transition: background 0.15s;
  }
  .m-index-card:active { background: #F5EDE3; }
}

/* ── Kontextuelle Infobox (unter «Rauchst du?») ────── */
/* Das Herz spricht: Chatbot-Sprechblase unten rechts, schwebt über dem Inhalt */
.tip-bubble-wrap {
  position: absolute;
  right: 74px;
  bottom: 70px;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  gap: 18px;
}
.tip-heart { flex: none; display: block; }
.tip-bubble {
  position: relative;
  width: 560px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px 16px 18px;
  background: #DCEBFF;
  border-radius: 17px;
  box-shadow: 0 6px 20px rgba(35, 46, 56, 0.12);
}
.tip-bubble.wide { width: 760px; }
/* Zipfel zum Herz (aus Sprechblase_Zipfel.svg, gespiegelt) */
.tip-bubble::after {
  content: "";
  position: absolute;
  right: -15px;
  bottom: 16px;
  width: 24px;
  height: 23px;
  background: url("../svg/Sprechblase_Zipfel.svg") center / contain no-repeat;
  transform: scaleX(-1);
}
.tip-icon { flex: none; display: block; }
.bubble-text {
  font-family: "Funnel Display", sans-serif;
  font-size: 17px;
  line-height: 1.35;
  color: #1E2D56;
}
/* Kleines Herz unten in der Karte «Beeinflussbar» mit den Regler-Tipps */
.mini-tip {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 8px;
}
.mini-tip-heart { flex: none; display: block; }
.mini-tip-bubble {
  position: relative;
  flex: 1;
  padding: 8px 12px 9px;
  background: #DCEBFF;
  border-radius: 14px;
}
.mini-tip-bubble::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 9px;
  width: 18px;
  height: 17px;
  background: url("../svg/Sprechblase_Zipfel.svg") center / contain no-repeat;
}
.info-box {
  font-family: "Funnel Display", sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  color: #1E2D56;
}
#info-box.info-idle { color: #5b7d99; }
#m-info-text.info-idle { color: #9DA0A6; }
.info-flash { animation: info-flash 0.5s ease; }
@keyframes info-flash {
  from { opacity: 0.25; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .info-flash { animation: none; }
}

/* ── Herzgitter: Zufällig verteilen ─────────────────── */
.hearts-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 14px;
}
.shuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid #d8dfe3;
  border-radius: 26px;
  background: #fffdfa;
  color: #232E38;
  font: 500 14px "Funnel Display", sans-serif;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.shuffle-btn:hover { border-color: #232E38; }
.shuffle-btn:active { transform: scale(0.95); }
.sort-link {
  padding: 0;
  border: none;
  background: none;
  color: #787878;
  font: 400 13px "Funnel Display", sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

/* Achsenbeschriftung: jede Zahl exakt an ihrem Wert, mit Teilstrich */
.ha-ticks span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  line-height: 1;
}
.ha-ticks span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  height: 5px;
  border-left: 1.5px solid #232e38;
}
#mobile .ha-ticks span { top: 4px; }
#mobile .ha-ticks span::before { top: -4px; height: 3px; border-left-width: 1px; border-color: #9da0a6; }

/* ── Herz-Wechsel: nur ein Herz sichtbar, mit Plopp beim Auftauchen/Verschwinden ── */
.tip-bubble-wrap > .tip-heart,
.tip-bubble-wrap > .tip-bubble,
.mini-tip > .mini-tip-heart,
.mini-tip > .mini-tip-bubble {
  opacity: 0;
  transform: scale(0);
}
.tip-bubble-wrap:not(.show),
.mini-tip:not(.show) { pointer-events: none; }
.tip-heart, .mini-tip-heart { transform-origin: 50% 85%; }
.tip-bubble { transform-origin: 100% 85%; }
.mini-tip-bubble { transform-origin: 0% 18px; }

/* Auftauchen: zuerst das Herz mit einem Herzschlag, danach bläst sich die Blase einmal auf */
.show > .tip-heart, .show > .mini-tip-heart {
  animation: heart-beat-in 0.8s ease-out forwards;
}
.show > .tip-bubble, .show > .mini-tip-bubble {
  animation: bubble-pop-in 0.35s cubic-bezier(.2,.9,.3,1.2) 0.7s forwards;
}
/* Verschwinden: zuerst die Blase, dann das Herz */
.hide > .tip-bubble, .hide > .mini-tip-bubble {
  animation: bubble-pop-out 0.22s ease-in forwards;
}
.hide > .tip-heart, .hide > .mini-tip-heart {
  opacity: 1; transform: scale(1);
  animation: heart-pop-out 0.3s ease-in 0.18s forwards;
}
@keyframes heart-beat-in {
  0%   { opacity: 0; transform: scale(0); }
  30%  { opacity: 1; transform: scale(1); }
  45%  { transform: scale(1.2); }
  58%  { transform: scale(0.97); }
  72%  { transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes bubble-pop-in {
  0%   { opacity: 0; transform: scale(0); }
  75%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes bubble-pop-out {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0); }
}
@keyframes heart-pop-out {
  0%   { opacity: 1; transform: scale(1); }
  35%  { opacity: 1; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(0); }
}
@media (prefers-reduced-motion: reduce) {
  .show > .tip-heart, .show > .tip-bubble, .show > .mini-tip-heart, .show > .mini-tip-bubble,
  .hide > .tip-heart, .hide > .tip-bubble, .hide > .mini-tip-heart, .hide > .mini-tip-bubble {
    animation: none;
  }
  .show > * { opacity: 1 !important; transform: none !important; }
}

/* Navigation mit Drucker-Button daneben */
.nav-row {
  position: absolute;
  left: 430px;
  top: 44px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-print {
  width: 64px;
  height: 64px;
  flex: none;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fdf9f5;
  box-shadow: 0 1px 2px rgba(35, 46, 56, 0.05);
  color: #232e38;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* dunkler Kreis innen wie die Pille in der Navigation */
.nav-print .np-inner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.1s ease, color 0.1s ease;
}
.nav-print:hover .np-inner,
.nav-print:focus-visible .np-inner {
  background-color: #232e38;
  color: #fdf9f5;
}

/* Tipps (Was kannst du tun): beim Darüberfahren hellblau und leicht grösser */
.tun-item {
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.12s cubic-bezier(.3,1.4,.5,1);
}
.tun-item:hover,
.tun-item.is-open {
  background: #DCEBFF;
  border-color: #DCEBFF !important;
}
.tun-item:hover { transform: scale(1.015); }

/* Slider-Knopf: beim Anfassen grösser, mit kleinem Federn */
[id$="-thumb"], .m-thumb { transition: transform 0.1s ease; }
[id^="track-"]:not(.slider-active):hover > [id$="-thumb"],
.m-track:not(.slider-active):hover > .m-thumb { transform: translate(-50%, -50%) scale(1.15) !important; }
.slider-active > [id$="-thumb"],
.slider-active > .m-thumb {
  animation: thumb-pop 0.16s cubic-bezier(.3,1.6,.5,1) forwards;
}
@keyframes thumb-pop {
  0%   { transform: translate(-50%, -50%) scale(1); }
  60%  { transform: translate(-50%, -50%) scale(1.45); }
  100% { transform: translate(-50%, -50%) scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
  .tun-item, .tun-item:hover { transition: none; transform: none; }
  .slider-active > [id$="-thumb"], .slider-active > .m-thumb { animation: none; }
}
/* Startseite: auch der orange Schein pulsiert nur beim Darüberfahren */
.hero-wrap .heartbeat-glow { animation-play-state: paused; }
.hero-wrap:hover .heartbeat-glow,
#app.hero-hot .hero-wrap .heartbeat-glow { animation-play-state: running; }

/* Kreisdiagramm: zugehörige Legende wird fett beim Darüberfahren */
.pie-legend-item { transition: font-weight 0.1s; }
.pie-legend-item.is-hot { font-weight: 700; }
.pie-slice { cursor: pointer; }
/* Startseite: beim Hover wird auch das Herz etwas grösser */
.hero-wrap > svg { transform-origin: 50% 90%; transition: transform 0.35s cubic-bezier(.3,1.4,.5,1); }
#app.hero-hot .hero-wrap > svg { transform: scale(1.05); }

/* Umschalter Frau/Mann und Nein/Ja: verspielt beim Hover und Drücken */
#btn-female, #btn-male, #btn-nein, #btn-ja,
#m-btn-female, #m-btn-male, #m-btn-nein, #m-btn-ja {
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), background-color 0.1s ease, color 0.1s ease;
}
#btn-female:hover, #btn-male:hover, #btn-nein:hover, #btn-ja:hover,
#m-btn-female:hover, #m-btn-male:hover, #m-btn-nein:hover, #m-btn-ja:hover {
  transform: scale(1.08);
}
#btn-female:active, #btn-male:active, #btn-nein:active, #btn-ja:active,
#m-btn-female:active, #m-btn-male:active, #m-btn-nein:active, #m-btn-ja:active {
  transform: scale(0.9);
  transition-duration: 0.05s;
}
/* frisch gewählt: kurz aufploppen */
.toggle-pop { animation: toggle-pop 0.18s cubic-bezier(.3,1.6,.5,1); }
@keyframes toggle-pop {
  0%   { transform: scale(0.9); }
  55%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #btn-female, #btn-male, #btn-nein, #btn-ja { transition: none; transform: none !important; }
  .toggle-pop { animation: none; }
}

/* Fragezeichen: wächst beim Darüberfahren */
button[aria-label^="Info"] {
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), background-color 0.1s ease;
}
button[aria-label^="Info"]:hover,
button[aria-label^="Info"]:focus-visible {
  transform: scale(1.3);
}

/* ──────────────── MOBILE: Startseite, Fragebogen, aufklappbare Werte ──────────────── */
@media (max-width: 900px) {
  .m-index-hero { padding: 28px 22px 10px; text-align: center; }
  .m-hero-heart { display: block; margin: 0 auto 8px; animation: hero-pulse 2.4s ease-in-out infinite; transform-origin: 50% 60%; }
  .m-index-lead { font-size: 16px; line-height: 1.45; color: #232e38; margin: 12px auto 22px; max-width: 340px; }
  .m-btn-primary, .m-btn-secondary {
    display: block; width: 100%; max-width: 340px; margin: 0 auto 10px;
    height: 52px; border-radius: 26px; font: 600 17px "Funnel Display", sans-serif;
    text-align: center; line-height: 52px; text-decoration: none; cursor: pointer;
  }
  .m-btn-primary { background: #232e38; color: #fdf9f5; border: none; }
  .m-btn-secondary { background: #fdf9f5; color: #232e38; border: 1px solid #d8dfe3; }
  .m-btn-primary:active, .m-btn-secondary:active { transform: scale(0.97); }
  .m-link-skip {
    display: inline-block; margin-top: 8px; padding: 6px 0;
    font-size: 15px; color: #232e38; text-decoration: underline; text-underline-offset: 3px;
  }

  /* aufklappbare Werte */
  .m-values {
    background: #fdf9f5; border-radius: 16px; margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(35,46,56,.04);
  }
  .m-values > summary {
    list-style: none; cursor: pointer; padding: 14px 16px;
    display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  }
  .m-values > summary::-webkit-details-marker { display: none; }
  .m-values-title { font: 600 16px "Source Serif 4", serif; color: #232e38; }
  .m-values-edit { grid-row: 1 / span 2; grid-column: 2; font-size: 14px; font-weight: 600; color: #4171B3; }
  .m-values-edit::after { content: " ▾"; }
  .m-values[open] .m-values-edit::after { content: " ▴"; }
  .m-values-sum { font-size: 13px; color: #787878; line-height: 1.35; }
  .m-values > .m-card { box-shadow: none; margin: 0 8px 8px; background: #fff; }
  .m-values > .m-tip { padding: 4px 16px 8px; }
  .m-values-again {
    display: block; margin: 4px 16px 16px; padding: 0; border: none; background: none;
    font: 600 14px "Funnel Display", sans-serif; color: #4171B3; text-decoration: underline; cursor: pointer;
  }
}

/* Fragebogen (Overlay, nur mobil genutzt) */
body.wz-open { overflow: hidden; }
#wizard {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  background: radial-gradient(125% 95% at 32% 42%, #FDF1E5 0%, #F9EAD9 55%, #F2DEC9 100%);
  font-family: "Funnel Display", sans-serif; color: #232e38;
  padding: max(16px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
}
.wz-progress { height: 6px; border-radius: 3px; background: #ead9c6; overflow: hidden; flex: none; }
.wz-progress > div { height: 100%; background: #EE5700; border-radius: 3px; transition: width 0.25s ease; }
/* Herz stellt die Frage in einer Sprechblase */
.wz-ask { display: flex; align-items: flex-start; gap: 16px; margin-top: 26px; flex: none; }
.wz-heart { flex: none; display: block; margin-top: 6px; }
.wz-bubble {
  position: relative; flex: 1; padding: 14px 18px;
  background: #DCEBFF; border-radius: 18px;
}
.wz-bubble::before {
  content: ""; position: absolute; left: -13px; top: 22px; width: 22px; height: 21px;
  background: url("../svg/Sprechblase_Zipfel.svg") center / contain no-repeat;
}
.wz-title { font: 600 26px/1.15 "Source Serif 4", serif; color: #1E2D56; margin: 0; }
.wz-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 460px; width: 100%; margin: 0 auto; }
.wz-hint { font-size: 15px; line-height: 1.45; color: #5a5a5a; margin: 20px 0 0; }
.wz-hint[hidden] { display: none; }
/* Auswahl wie die Umschalter im Tool */
.wz-choices {
  display: flex; height: 64px; padding: 4px; gap: 4px;
  border-radius: 32px; background: #fffdfa; border: 1px solid #d8dfe3;
}
.wz-choice {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 28px; background: transparent;
  font: 600 19px "Funnel Display", sans-serif; color: #232e38; cursor: pointer;
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), background-color 0.1s, color 0.1s;
}
.wz-choice:active { transform: scale(0.94); }
.wz-choice.is-on { background: var(--on); color: #fff; }
.wz-choice.is-on img { filter: brightness(0) invert(1); }
/* Zahl + Regler wie im Tool */
.wz-value { text-align: center; margin-bottom: 18px; }
.wz-num { font: 600 56px "Source Serif 4", serif; }
.wz-unit { font-size: 17px; color: #787878; }
.wz-slider { display: flex; align-items: center; gap: 12px; }
.wz-step {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid #d8dfe3; background: #fffdfa;
  font-size: 24px; line-height: 1; color: #232e38; cursor: pointer;
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1);
}
.wz-step:active { transform: scale(0.88); }
.wz-range {
  -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 16px; border-radius: 8px; outline: none; margin: 0;
  background: linear-gradient(to right, var(--fill, #4171B3) var(--pct, 50%), #cdcdcd var(--pct, 50%));
}
.wz-range[data-track] { background: var(--track); }
.wz-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 2px solid #232e38; box-shadow: 0 1px 4px rgba(35,46,56,.3);
}
.wz-range:not([data-track])::-webkit-slider-thumb { border-color: #4171B3; }
.wz-range::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #232e38; }
.wz-minmax { display: flex; justify-content: space-between; font-size: 13px; color: #787878; margin: 8px 56px 0; }
/* Zurück links neben Weiter */
.wz-bottom { display: flex; gap: 10px; max-width: 460px; width: 100%; margin: 0 auto; flex: none; }
.wz-back {
  flex: 0 0 38%; height: 56px; border-radius: 28px; border: 1px solid #d8dfe3; background: #fffdfa;
  font: 600 17px "Funnel Display", sans-serif; color: #232e38; cursor: pointer;
}
.wz-back[hidden] { display: none; }
.wz-next {
  flex: 1; height: 56px; border: none; border-radius: 28px;
  background: #232e38; color: #fdf9f5; font: 600 18px "Funnel Display", sans-serif; cursor: pointer;
}
.wz-next:active, .wz-back:active { transform: scale(0.97); }

/* ── Mobile: eine lange Ergebnisseite + sprechendes Herz ── */
#m-bubble { display: none; }
@media (max-width: 900px) {
  .m-section { scroll-margin-top: 110px; }
  .m-section + .m-section { margin-top: 18px; }
  body.m-all .m-main { padding-bottom: 150px; }

  #m-bubble {
    display: flex; align-items: flex-end; gap: 10px;
    position: fixed; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px; justify-content: flex-end;
    z-index: 200; pointer-events: none;
  }
  .m-bubble-box {
    position: relative; pointer-events: auto;
    max-width: 280px; padding: 12px 30px 12px 14px;
    background: #DCEBFF; color: #1E2D56; border-radius: 17px;
    font-size: 14px; line-height: 1.4;
    box-shadow: 0 6px 20px rgba(35,46,56,.15);
    margin-bottom: 18px;
    transform-origin: 100% 85%;
    transition: transform 0.18s cubic-bezier(.3,1.4,.5,1), opacity 0.15s ease;
  }
  .m-bubble-box::after {
    content: ""; position: absolute; right: -12px; bottom: 14px;
    width: 20px; height: 19px;
    background: url("../svg/Sprechblase_Zipfel.svg") center / contain no-repeat;
    transform: scaleX(-1);
  }
  .m-bubble-x {
    position: absolute; top: 4px; right: 6px; width: 24px; height: 24px;
    border: none; background: none; padding: 0;
    font-size: 20px; line-height: 1; color: #1E2D56; cursor: pointer;
  }
  .m-bubble-heart {
    pointer-events: auto; border: none; background: none; padding: 0; cursor: pointer;
    transition: transform 0.12s cubic-bezier(.3,1.6,.5,1);
  }
  .m-bubble-heart:active { transform: scale(0.9); }
  .m-bubble-heart img { display: block; }
  #m-bubble.is-closed .m-bubble-box { transform: scale(0); opacity: 0; pointer-events: none; }
  #m-bubble.pop .m-bubble-heart { animation: heart-beat-in 0.6s ease-out; }
  body.wz-open #m-bubble { display: none; }
}

/* Mobile Herzalter-Grafik wie Desktop */
@media (max-width: 900px) {
  .mha { position: relative; height: 196px; margin: 0 6px 0 0; }
  .mha-label { position: absolute; left: 0; font-size: 14px; color: #232e38; }
  .mha-bar { position: absolute; left: 0; height: 12px; border-radius: 3px; width: 0; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
  .mha-icon { position: absolute; transform: translateX(-50%); transition: left 0.6s cubic-bezier(.2,.8,.2,1); left: 0; }
  .mha-line { position: absolute; top: 0; bottom: 38px; border-left: 1.5px dashed #232e38; }
  .mha-model { border-left-color: #c5cbd0; left: 69%; display: none; }
  .mha-line-label { position: absolute; top: -2px; font-size: 10px; font-weight: 600; line-height: 1.2; color: #232e38; width: 90px; }
  .mha-axis { position: absolute; left: 0; right: 0; bottom: 38px; border-top: 1.5px solid #232e38; }
  .mha-ticks { position: absolute !important; left: 0; right: 0; bottom: 20px; height: 14px !important; font-size: 12px !important; color: #232e38 !important; }
  #mobile .mha-ticks span::before { border-color: #232e38; }
  .mha-caption { position: absolute; left: 0; bottom: 0; font-size: 12px; color: #232e38; }
}

@media (max-width: 900px) {
  .m-pie-legend { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: #232e38; margin: 6px 0 14px; }
  .m-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
  .m-result-num { font-size: 40px; line-height: 1.1; }
}

/* ── Mobile: Kopf mit Herz + Region, Navigation unten, Typografie ── */
#m-region-sheet { display: none; }
@media (max-width: 900px) {
  .m-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-bottom: none;
    background: rgba(249,234,217,.92);
  }
  .m-header .m-logo { margin: 0; display: block; line-height: 0; }
  .m-region-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
    border: 1px solid #d8dfe3; border-radius: 18px; background: #fdf9f5;
    font: 500 14px "Funnel Display", sans-serif; color: #232e38; cursor: pointer;
  }
  .m-region-btn:active { transform: scale(0.95); }

  /* Navigation unten */
  .m-tabbar {
    position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 300; display: flex; align-items: center; gap: 4px;
    width: auto; max-width: none;
    padding: 5px; border-radius: 30px; background: #fdf9f5;
    box-shadow: 0 6px 24px rgba(35,46,56,.16); overflow: visible;
  }
  .m-tabbar a {
    flex: 1 1 0; text-align: center; padding: 11px 4px; border-radius: 24px;
    font-size: 14px; font-weight: 600; white-space: nowrap;
  }
  .m-tab-print {
    flex: none; width: 44px; height: 44px; border: none; border-radius: 50%;
    background: #232e38; color: #fdf9f5; display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .m-tab-print:active { transform: scale(0.92); }
  .m-main { padding-bottom: 170px; }
  .m-footer { padding-bottom: 90px; }

  /* Sprechendes Herz über der Navigation */
  #m-bubble { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 66px); }

  /* Typografie: Titel am grössten */
  .m-page-title { font-size: 28px; line-height: 1.15; margin-bottom: 14px; }
  .m-result-num { font-size: 36px; }
  .m-values-title { font-size: 17px; }
  .m-summary, #m-herzalter-summary, #m-risiko-summary { font-size: 15px !important; line-height: 1.45; }
  .m-card { padding: 18px 16px; }

  /* Länderauswahl */
  #m-region-sheet { display: block; position: fixed; inset: 0; z-index: 1100; pointer-events: none; }
  #m-region-sheet .m-sheet-bg { position: absolute; inset: 0; background: rgba(35,46,56,.35); opacity: 0; transition: opacity .2s; }
  #m-region-sheet .m-sheet {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 75vh; display: flex; flex-direction: column;
    background: #fdf9f5; border-radius: 20px 20px 0 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom));
    transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
  }
  #m-region-sheet.is-open { pointer-events: auto; }
  #m-region-sheet.is-open .m-sheet-bg { opacity: 1; }
  #m-region-sheet.is-open .m-sheet { transform: none; }
  .m-sheet-head { display: flex; justify-content: space-between; align-items: center; font: 600 20px "Source Serif 4", serif; }
  .m-sheet-head button { border: none; background: none; font-size: 26px; line-height: 1; color: #232e38; cursor: pointer; }
  .m-sheet-hint { font-size: 14px; color: #6b6b6b; margin: 6px 0 10px; }
  .m-sheet-list { overflow-y: auto; }
  .m-sheet-list button {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 12px 4px; border: none; border-bottom: 1px solid #efe7dd; background: none;
    font: 500 16px "Funnel Display", sans-serif; color: #232e38; cursor: pointer; text-align: left;
  }
  .m-sheet-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
}
@media (max-width: 900px) {
  /* Aussage steht in der Sprechblase des Herzens (wie Desktop) */
  #m-risiko-summary, #m-tun-tip, div:has(> #m-herzalter-summary) { display: none !important; }
}
@media (max-width: 900px) {
  /* Grafik-Box reicht bis kurz über das Herz und die Navigation */
  body:not(.m-all) #m-main {
    display: flex; flex-direction: column;
    min-height: calc(100vh - 60px);
    min-height: calc(100dvh - 60px);
    padding-bottom: 175px;
  }
  body:not(.m-all) #m-main > .m-card:last-child { flex: 1 0 auto; }
  #m-bubble { right: 10px; left: 10px; }
}

/* ── Mobile: Werte-Bereich aufgeklappt = weisses Blatt über die ganze Breite ── */
@media (max-width: 900px) {
  .m-ve-close { display: none; }
  .m-values[open] .m-ve-open { display: none; }
  .m-values[open] .m-ve-close { display: inline; }
  .m-values[open] .m-values-edit::after { content: ""; }
  .m-values-edit .m-ve-close {
    background: #232e38; color: #fdf9f5; padding: 7px 14px; border-radius: 16px;
  }

  .m-values[open] {
    position: fixed; z-index: 450;
    top: 64px; left: 10px; right: 10px; bottom: 0;
    margin: 0; border-radius: 18px 18px 0 0;
    background: #fff; overflow-y: auto; -webkit-overflow-scrolling: touch;
    box-shadow: 0 -4px 24px rgba(35,46,56,.12);
    padding-bottom: 150px;
    animation: m-sheet-in .22s cubic-bezier(.2,.8,.2,1);
  }
  @keyframes m-sheet-in { from { transform: translateY(-16px); } to { transform: none; } }
  .m-values[open] > summary {
    position: sticky; top: 0; z-index: 2; background: #fff;
    border-bottom: 1px solid #f0ebe4; padding: 14px 18px;
  }
  body.m-values-open { overflow: hidden; }
  body.m-values-open .m-tabbar { display: none; }
  /* alles dahinter (auch Kopf mit Herz und Region) wird heller */
  body.m-values-open #mobile::before {
    content: ""; position: fixed; inset: 0; z-index: 440;
    background: rgba(253, 249, 245, 0.72);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  }
  /* Tipp-Herz bleibt unten sichtbar, über dem Dropdown */
  body.m-values-open #m-bubble { z-index: 470; bottom: max(12px, env(safe-area-inset-bottom)); }

  /* Regler untereinander, volle Breite */
  .m-values > .m-card { margin: 0 12px 10px; padding: 16px; background: #FBF7F2; }
  .m-values [style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 18px !important; }
  .m-values .m-track { height: 14px !important; }
  .m-values .m-thumb { width: 26px !important; height: 26px !important; }
  .m-values .m-val-input { font-size: 16px !important; width: 56px !important; }

  /* Regler-Tipp steht unten im sprechenden Herz, nicht im Werte-Bereich */
  .m-tip { display: none !important; }
}
}
@media (max-width: 900px) {
  /* kein blauer Fokus-Rahmen beim Antippen von «Deine Werte» */
  .m-values > summary:focus, .m-values > summary:focus-visible { outline: none; }
  .m-values { outline: none; }
}

/* ── Mobile v3: Navigation oben, Werte unten angedockt, Weiter-Knopf ── */
@media (max-width: 900px) {
  .m-header { position: sticky; top: 0; z-index: 300; }
  .m-tabbar {
    position: sticky; top: 58px; left: auto; right: auto; bottom: auto;
    margin: 0 12px 4px; z-index: 290;
    box-shadow: 0 2px 10px rgba(35,46,56,.08);
  }
  .m-tabbar a { font-size: 15px; padding: 10px 4px; }
  .m-tab-print { width: 40px; height: 40px; }

  /* Inhalt: Karte darf hinter das Herz reichen */
  body:not(.m-all) #m-main { padding: 10px 12px 190px; min-height: calc(100dvh - 120px); }
  .m-next { margin: 16px 0 0; text-align: center; }
  .m-next .m-btn-primary { max-width: none; }

  /* Werte: unten angedockte Leiste zum Hochziehen */
  .m-values {
    position: fixed; z-index: 320; left: 0; right: 0; bottom: 0; margin: 0;
    border-radius: 20px 20px 0 0; background: #fff;
    box-shadow: 0 -6px 24px rgba(35,46,56,.14);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .m-values > summary { padding: 18px 18px 14px; position: relative; }
  .m-values-grip {
    position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px;
    border-radius: 3px; background: #d8cfc4;
  }
  .m-values-title { font-size: 18px; }
  .m-values-edit .m-ve-open {
    background: #232e38; color: #fdf9f5; padding: 8px 14px; border-radius: 16px;
  }
  .m-values-edit::after { content: "" !important; }

  .m-values[open] {
    top: 64px; left: 0; right: 0; bottom: 0;
    border-radius: 20px 20px 0 0;
    animation: m-sheet-up .25s cubic-bezier(.2,.8,.2,1);
    padding-bottom: 150px;
  }
  @keyframes m-sheet-up { from { transform: translateY(40px); } to { transform: none; } }

  /* Herz über der angedockten Werte-Leiste */
  #m-bubble { bottom: calc(env(safe-area-inset-bottom) + 92px); }
  body.m-values-open #m-bubble { bottom: max(12px, env(safe-area-inset-bottom)); }
  body.m-values-open .m-tabbar { display: flex; }

  /* Lesbarkeit / Hierarchie */
  .m-page-title { font-size: 27px; }
  .m-card { border-radius: 18px; }
  .mha-label, .m-legend-row, .m-pie-legend { font-size: 15px; }
}
@media (max-width: 900px) {
  body:not(.m-all) #m-main > .m-card:has(+ .m-next) { flex: 1 0 auto; }
  .m-index-hero .m-index-title { margin: 18px 0 26px; }
}

/* ── Mobile v4 ── */
@media (max-width: 900px) {
  /* Kopf: Herz links, Navigation rechts daneben */
  .m-header { gap: 10px; padding: 8px 10px 8px 14px; }
  .m-header .m-tabbar {
    position: static; margin: 0; flex: 1; min-width: 0;
    box-shadow: 0 1px 6px rgba(35,46,56,.08); padding: 4px;
  }
  .m-header .m-tabbar a { font-size: 14px; padding: 9px 2px; }
  .m-header .m-tab-print { width: 36px; height: 36px; }
  .m-region-btn { display: none; }

  /* Region im Werte-Bereich */
  .m-values-region {
    display: flex; justify-content: space-between; align-items: center; width: calc(100% - 24px);
    margin: 12px 12px 10px; padding: 14px 16px; border: none; border-radius: 14px;
    background: #FBF7F2; font: 600 15px "Funnel Display", sans-serif; color: #232e38; cursor: pointer; text-align: left;
  }
  .m-vr-val { color: #4171B3; }

  /* Herzalter höher und grösser */
  .mha { height: 300px; }
  .mha-label { font-size: 17px; }
  .mha-bar { height: 18px; border-radius: 4px; }
  .mha-line, .mha-axis { bottom: 46px; }
  .mha-line-label { font-size: 12px; width: 110px; }
  .mha-ticks { bottom: 24px; font-size: 14px !important; }
  .mha-caption { font-size: 14px; }

  /* Titel grösser, Ergebniszahl kleiner als der Titel */
  .m-page-title { font-size: 30px; line-height: 1.12; }
  .m-result-num { font-size: 26px; margin-top: 4px; }
  #m-main .m-card p, #m-main .m-card > div[style*="line-height: 1.4"] { line-height: 1.55 !important; }

  /* Karte reicht bis unter das Tipp-Herz, Weiter-Knopf weiss unten rechts in der Karte */
  body:not(.m-all) #m-main { padding-bottom: 100px; min-height: calc(100dvh - 60px); }
  body:not(.m-all) #m-main > .m-card:last-of-type { flex: 1 0 auto; padding-bottom: 92px; position: relative; }
  .m-next { position: absolute; right: 16px; bottom: 18px; margin: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
  .m-next .m-btn-primary {
    display: inline-block; width: auto; height: 48px; line-height: 48px; padding: 0 20px; margin: 0;
    background: #fff; color: #232e38; border: 1px solid #d8dfe3; font-size: 16px;
    box-shadow: 0 2px 8px rgba(35,46,56,.08);
  }
  .m-next .m-link-skip { font-size: 14px; }
  #m-bubble { bottom: calc(env(safe-area-inset-bottom) + 170px); }
}
@media (max-width: 900px) {
  /* Tipp-Herz tief, direkt über der Werte-Leiste */
  #m-bubble { bottom: calc(env(safe-area-inset-bottom) + 96px); }
  /* Weiter-/Drucken-Knopf am Ende des Inhalts (im Fluss, nicht schwebend);
     darunter bleibt in der weissen Box Platz für das Tipp-Herz */
  .m-next {
    position: static; margin: 22px 0 0; align-items: flex-end;
  }
  body:not(.m-all) #m-main > .m-card:last-of-type { padding-bottom: 120px; }
}

/* ── Fragebogen v3: grösser, näher beieinander, Kacheln ── */
.wz-ask { margin-top: 56px; gap: 14px; align-items: center; }
.wz-title { font-size: 31px; line-height: 1.12; }
.wz-bubble { padding: 18px 20px; }
.wz-bubble::before { top: 50%; margin-top: -10px; }
.wz-body { justify-content: flex-start; margin-top: 34px; }
.wz-choices {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  height: auto; padding: 0; border: none; background: none; border-radius: 0;
}
.wz-choice {
  height: 132px; flex-direction: column; gap: 10px;
  border-radius: 20px; border: 2px solid #e6dccf; background: #fffdfa;
  font-size: 20px;
}
.wz-choice.is-on { border-color: var(--on); }
.wz-next:disabled { opacity: 0.35; cursor: default; }
.wz-value { margin-bottom: 14px; }
.wz-hint { font-size: 16px; }

@media (max-width: 900px) {
  .m-next .m-btn-primary { box-shadow: none; }
  body:not(.m-all) #m-main { min-height: calc(100dvh - 48px); padding-bottom: 88px; }
  /* Schrift in den Grafiken grösser */
  .mha-label { font-size: 18px; }
  .mha-ticks { font-size: 15px !important; }
  .mha-caption { font-size: 15px; }
  .m-legend-row, .m-pie-legend { font-size: 16px; }
  #m-main .m-card { font-size: 16px; }
}
@media (max-width: 900px) {
  /* Werte-Leiste: «Deine Werte» klein, die Werte selbst gross und gut lesbar */
  .m-values > summary { grid-template-columns: 1fr auto; row-gap: 3px; }
  .m-values-title {
    font-family: "Funnel Display", sans-serif; font-weight: 500;
    font-size: 13px; color: #787878; letter-spacing: 0.01em;
  }
  .m-values-sum { font-size: 17px; font-weight: 400; color: #232e38; line-height: 1.35; }

  /* Regler im Werte-Blatt wie im Fragebogen: gross und gut zu greifen */
  .m-values .m-track { height: 16px !important; border-radius: 8px !important; margin: 6px 0; }
  .m-values .m-fill { border-radius: 8px !important; }
  .m-values .m-thumb {
    width: 32px !important; height: 32px !important;
    border-width: 2px !important; box-shadow: 0 1px 4px rgba(35,46,56,.3) !important;
  }
  .m-values .m-val-input { font-size: 18px !important; width: 64px !important; height: 38px; }
  .m-values .m-card span[style*="font-size: 12px"] { font-size: 15px !important; }
  .m-values .m-toggle { height: 48px !important; }
  .m-values .m-toggle-btn { font-size: 17px !important; }
}
/* ── Mobile Startseite: Titel oben, Herz gross in der Mitte, Start unten ── */
@media (max-width: 900px) {
  .m-start-screen {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: max(48px, env(safe-area-inset-top)) 24px max(18px, env(safe-area-inset-bottom));
  }
  .m-start-title {
    font: 600 36px/1.1 "Source Serif 4", serif; color: #232e38; max-width: 320px;
  }
  .m-start-heart { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 0; }
  .m-start-heart .m-hero-heart { width: min(64vw, 260px); height: auto; }
  .m-start-actions { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .m-start-actions .m-btn-primary { max-width: none; height: 56px; line-height: 56px; font-size: 18px; margin: 0; }
  .m-start-footer { margin-top: 22px; }
  .m-start-footer a { font-size: 14px; color: #94837a; text-decoration: none; }
}
/* Fragebogen: Frage weiter unten, Zahl und Regler mittig im freien Raum */
.wz-ask { margin-top: 12vh; margin-top: 12dvh; }
.wz-body { justify-content: center; margin-top: 0; padding-bottom: 8vh; }
/* Fragebogen: Zurück und Weiter gleich breit, verspielt beim Drücken */
.wz-back, .wz-next { flex: 1 1 0; }
.wz-back, .wz-next, .wz-choice, .wz-step {
  transition: transform 0.14s cubic-bezier(.3,1.6,.5,1), background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.wz-back:active, .wz-next:active, .wz-step:active { transform: scale(0.92); transition-duration: 0.06s; }
.wz-choice:active { transform: scale(0.94); transition-duration: 0.06s; }
.wz-choice.is-on { animation: wz-pop 0.32s cubic-bezier(.3,1.6,.5,1); }
.wz-next:not(:disabled) { animation: wz-ready 0.3s cubic-bezier(.3,1.6,.5,1); }
@keyframes wz-pop {
  0% { transform: scale(0.94); }
  55% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes wz-ready {
  0% { transform: scale(0.96); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@media (hover: hover) {
  .wz-back:hover, .wz-step:hover { border-color: #232e38; }
  .wz-next:not(:disabled):hover { transform: scale(1.02); }
  .wz-choice:hover { border-color: #b9c3cc; }
}
@media (prefers-reduced-motion: reduce) {
  .wz-choice.is-on, .wz-next:not(:disabled) { animation: none; }
}
/* Zahl, Regler und Kacheln etwas höher */
.wz-body { padding-bottom: 18vh; padding-bottom: 18dvh; }
/* lange Wörter in der Frage nur bei Platzmangel trennen */
.wz-title { hyphens: manual; -webkit-hyphens: manual; overflow-wrap: break-word; }
.wz-count-top { font-size: 14px; font-weight: 600; color: #787878; margin: 0 0 8px; flex: none; }
/* Frage-Bereich mit fester Höhe: eine dreizeilige Frage verschiebt weder Herz noch Regler */
.wz-ask { align-items: flex-start; height: 150px; }
.wz-heart { margin-top: 14px; }
.wz-bubble::before { top: 40px; margin-top: 0; }
/* Herzalter mobil: dicke Balken, Text darunter, Grafik mittig */
@media (max-width: 900px) {
  .mha { height: 340px; }
  .mha-bar { height: 44px; border-radius: 6px; }
  .mha-label { font-size: 18px; }
  .mha-line-label { font-size: 14px; width: 140px; line-height: 1.25; }
  .mha-line, .mha-axis { bottom: 46px; }
  body:not(.m-all) #m-main > .m-card:has(.mha) { display: flex; flex-direction: column; }
  .m-card:has(.mha) .m-page-title { font-size: 34px; margin-top: 18px; }
  .mha-wrap { margin: auto 0; padding: 24px 0; }
}
@media (max-width: 900px) {
  /* Werte-Blatt fährt von unten herauf und wieder hinunter */
  .m-values[open] { animation: m-sheet-rise 0.32s cubic-bezier(.2,.8,.2,1); }
  .m-values[open].is-closing { animation: m-sheet-drop 0.26s cubic-bezier(.4,0,.8,.4) forwards; }
  @keyframes m-sheet-rise { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes m-sheet-drop { from { transform: none; } to { transform: translateY(100%); } }
  /* kein Spalt unten: Fläche reicht unter den Bildschirmrand */
  .m-values { box-shadow: 0 -6px 24px rgba(35,46,56,.14), 0 60px 0 0 #fff; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .m-values[open], .m-values[open].is-closing { animation: none; }
}
@media (max-width: 900px) {
  /* «Zufällige Anordnung» gross genug zum Antippen */
  #mobile .shuffle-btn { height: 52px; padding: 0 22px; font-size: 17px; gap: 10px; border-radius: 26px; }
  #mobile .shuffle-btn svg { width: 22px; height: 22px; }
  #mobile .sort-link { font-size: 16px; }
}
@media (max-width: 900px) {
  /* Titel überall gleich hoch und etwas grösser */
  .m-page-title, .m-card:has(.mha) .m-page-title { font-size: 33px; margin-top: 0; }
  /* «Alter in Jahren» bündig mit der 0 */
  .mha-caption { left: -5px; }
  /* Herzchen: mehr Luft rundherum */
  #mobile .m-hearts-grid { gap: 4px; margin: 18px 0 16px; }
  #mobile .m-legend { margin: 6px 0 16px; gap: 10px; }
  /* Drucker: weiss mit dunklem Symbol, dunkel nur beim Drücken */
  .m-header .m-tab-print, .m-tab-print {
    background: #fff; color: #232e38; border: 1px solid #d8dfe3;
  }
  .m-tab-print:active { background: #232e38; color: #fdf9f5; border-color: #232e38; }
  /* Was tun: Tipp-Texte und Legende etwas grösser */
  #mobile .tun-body p { font-size: 16px !important; line-height: 1.5 !important; }
  #mobile .m-pie-legend { font-size: 17px; }
  #mobile [onclick^="toggleTunItem"] span { font-size: 17px !important; }
}
@media (max-width: 900px) {
  .m-opt {
    position: absolute; top: -4px; bottom: -4px;
    border: 1.5px dashed #acacac; border-radius: 10px;
    background: rgba(255,255,255,.25); pointer-events: none;
  }
  .m-opt-label {
    position: relative; display: inline-block; transform: translateX(-50%);
    font-size: 13px; font-weight: 600; color: #232e38; margin-top: 4px; white-space: nowrap;
  }
  .m-values .m-track { position: relative; }
}
@media (max-width: 900px) {
  /* keine farbige Antipp-Markierung (iOS/Android) */
  #mobile summary, #mobile button, #mobile a, #wizard button, #m-region-sheet button { -webkit-tap-highlight-color: transparent; }
  .m-values > summary { -webkit-user-select: none; user-select: none; }
}
/* Fragebogen: Kopf mit Herz und Navigation */
.wz-head { display: flex; align-items: center; gap: 10px; margin: 0 -6px 14px; flex: none; }
.wz-home { line-height: 0; flex: none; }
.wz-nav {
  flex: 1; display: flex; gap: 4px; padding: 4px; border-radius: 30px; background: #fdf9f5;
  box-shadow: 0 1px 6px rgba(35,46,56,.08);
}
.wz-nav a {
  flex: 1 1 0; text-align: center; padding: 9px 2px; border-radius: 24px;
  font: 600 14px "Funnel Display", sans-serif; color: #232e38; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.wz-nav a:active { background: #232e38; color: #fdf9f5; }
.wz-ask { margin-top: 7vh; margin-top: 7dvh; }
@media (max-width: 900px) {
  .m-start-screen { min-height: calc(100dvh - 56px); padding-top: 28px; }
}
@media (max-width: 900px) {
  /* Tipps (Was tun): Einträge 1.5-mal so hoch, Text grösser */
  #mobile [onclick^="toggleTunItem"] { padding: 22px 18px !important; gap: 14px !important; }
  #mobile [onclick^="toggleTunItem"] span,
  #mobile [onclick^="toggleTunItem"] div[style*="font-size"] { font-size: 20px !important; }
  #mobile [onclick^="toggleTunItem"] img { width: 32px !important; height: 32px !important; object-fit: contain; }
  #mobile .tun-body p { font-size: 17px !important; padding: 14px 18px 20px !important; }
}
