:root {
  --paper: #f5efe4;
  --card: #fffaf2;
  --ink: #1d2726;
  --muted: #66706d;
  --line: #e4dccd;
  --teal: #14524f;
  --teal-2: #1f6f6a;
  --teal-soft: #d8e8e4;
  --amber: #e07a2f;
  --amber-soft: #fbe3cf;
  --red: #b3412e;
  --red-soft: #f8dcd5;
  --green: #2f7a4b;
  --green-soft: #dcefe1;
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-size: 17px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1 { font-family: Georgia, "Noto Serif", "Times New Roman", serif; font-weight: 600; font-size: 1.85rem; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }
svg { width: 24px; height: 24px; fill: currentColor; }

.screen { display: none; min-height: 100%; padding: 20px 18px calc(28px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--teal-2); font-weight: 700; margin-bottom: 4px; }
.label { font-weight: 700; font-size: .9rem; margin: 22px 0 10px; color: var(--ink); }
.error { color: var(--red); margin-top: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--teal); }

.btn { border-radius: 14px; padding: 13px 18px; font-weight: 650; text-align: center; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.secondary { background: var(--teal-soft); color: var(--teal); }
.btn.ghost { background: transparent; color: var(--teal); border: 1px solid var(--line); }
.btn.big { padding: 17px 20px; font-size: 1.05rem; }
.btn.small { padding: 9px 14px; font-size: .9rem; }
.btn:disabled { opacity: .5; }

.banner { background: var(--amber-soft); color: #7a3c10; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-weight: 600; }
.banner.warn { background: var(--red-soft); color: var(--red); }

/* Code */
.center-wrap { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: stretch; text-align: center; gap: 8px; }
.logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 10px; }
#code-input { padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: center; font-size: 1.1rem; }

/* Home */
.streak-card { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.streak-num { font-family: Georgia, serif; font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--teal); }
.week { display: flex; gap: 7px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .7rem; color: var(--muted); }
.week .d i { width: 22px; height: 22px; border-radius: 50%; background: var(--line); display: block; }
.week .d.on i { background: var(--amber); }
.week .d.today span { color: var(--ink); font-weight: 700; }

.start-btn {
  margin: 22px 0 4px; width: 100%; border-radius: 28px; padding: 26px 20px;
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-2) 100%); color: #fff;
  display: flex; align-items: center; gap: 18px; box-shadow: 0 14px 30px -14px rgba(20,82,79,.7);
  transition: transform .15s ease;
}
.start-btn:active { transform: scale(.98); }
.start-btn.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(224,122,47,.55); } 50% { box-shadow: 0 0 0 14px rgba(224,122,47,0); } }
.start-mic { width: 64px; height: 64px; border-radius: 50%; background: var(--amber); display: grid; place-items: center; flex: none; }
.start-mic svg { width: 34px; height: 34px; }
.start-text { font-family: Georgia, serif; font-size: 1.45rem; font-weight: 600; text-align: left; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: .92rem; }
.chip.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.chips.days .chip { padding: 8px 0; width: 42px; }

.history-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.history-list li button { width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.history-list .h-main { font-weight: 650; }
.history-list .h-sub { color: var(--muted); font-size: .85rem; }
.history-list .h-count { background: var(--amber-soft); color: #7a3c10; border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; white-space: nowrap; }

/* Session */
.session { display: none; flex-direction: column; height: 100dvh; padding-bottom: calc(12px + var(--safe-b)); }
.session.active { display: flex; }
.session-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill { background: var(--teal-soft); color: var(--teal); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
#timeup-banner { margin: 12px 0 0; }

.stage { display: flex; flex-direction: column; align-items: center; padding: 18px 0 6px; flex: none; }
.orb { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.orb-core { width: 104px; height: 104px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; z-index: 2; transition: background .3s ease, transform .3s ease; box-shadow: 0 10px 30px -10px rgba(20,82,79,.6); }
.ring { position: absolute; inset: 23px; border-radius: 50%; border: 2px solid var(--teal); opacity: 0; }
.bars { display: flex; gap: 5px; align-items: center; height: 36px; }
.bars i { width: 6px; height: 8px; border-radius: 3px; background: #fff; opacity: .9; transition: height .2s; }

.orb[data-state="speaking"] .bars i { animation: bar .9s ease-in-out infinite; }
.orb[data-state="speaking"] .bars i:nth-child(2) { animation-delay: .15s; }
.orb[data-state="speaking"] .bars i:nth-child(3) { animation-delay: .3s; }
.orb[data-state="speaking"] .bars i:nth-child(4) { animation-delay: .45s; }
.orb[data-state="speaking"] .bars i:nth-child(5) { animation-delay: .6s; }
@keyframes bar { 0%,100% { height: 8px; } 50% { height: 34px; } }

.orb[data-state="listening"] .orb-core { background: var(--amber); }
.orb[data-state="listening"] .ring { border-color: var(--amber); animation: ripple 2.1s ease-out infinite; }
.orb[data-state="listening"] .r2 { animation-delay: .7s; }
.orb[data-state="listening"] .r3 { animation-delay: 1.4s; }
@keyframes ripple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }

.orb[data-state="thinking"] .orb-core { animation: breathe 1.4s ease-in-out infinite; }
.orb[data-state="thinking"] .bars i { height: 6px; width: 6px; animation: dot 1.2s ease-in-out infinite; }
.orb[data-state="thinking"] .bars i:nth-child(2) { animation-delay: .2s; }
.orb[data-state="thinking"] .bars i:nth-child(3) { animation-delay: .4s; }
.orb[data-state="thinking"] .bars i:nth-child(4), .orb[data-state="thinking"] .bars i:nth-child(5) { display: none; }
@keyframes dot { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(.94); } }
.orb[data-state="idle"] .orb-core, .orb[data-state="paused"] .orb-core { background: #8a9592; }

.state-label { margin-top: 10px; font-weight: 700; color: var(--teal); }
.live-text { min-height: 1.5em; margin-top: 6px; color: var(--muted); text-align: center; font-style: italic; padding: 0 10px; }

.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 8px 2px 12px; scroll-behavior: smooth; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: .97rem; }
.msg.teacher { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.student { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 6px; }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-size: .85rem; padding: 2px; }
.msg.hidden-text { cursor: pointer; }
.msg.hidden-text .txt { filter: blur(6px); user-select: none; }
.msg.hidden-text::after { content: "Antippen zum Mitlesen"; display: block; font-size: .78rem; color: var(--teal-2); font-weight: 700; margin-top: 6px; }
.hoertext { display: block; margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: var(--teal-soft); }
.hoertext.covered { cursor: pointer; }
.hoertext.covered .ht { filter: blur(7px); user-select: none; }
.hoertext .ht-label { display: block; font-size: .78rem; font-weight: 700; color: var(--teal); margin-bottom: 4px; }

.controls { display: flex; justify-content: space-around; align-items: center; padding-top: 6px; flex: none; }
.round-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--teal); font-size: .78rem; font-weight: 650; width: 70px; }
.round-btn svg { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.round-btn.on svg { background: var(--amber); color: #fff; border-color: var(--amber); }
.mic-btn { width: 84px; height: 84px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -10px rgba(20,82,79,.8); transition: transform .15s, background .2s; }
.mic-btn svg { width: 38px; height: 38px; }
.mic-btn:active { transform: scale(.95); }
.mic-btn .ic-send { display: none; }
.mic-btn.listening { background: var(--amber); }
.mic-btn.listening .ic-mic { display: none; }
.mic-btn.listening .ic-send { display: block; }
.mic-btn:disabled { opacity: .45; }
.mic-hint { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 8px; min-height: 1.2em; flex: none; }

/* Feedback */
.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 60px 0; color: var(--muted); }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--teal-soft); border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card-title { font-weight: 750; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--teal-2); margin-bottom: 8px; }
.card.praise { background: var(--green-soft); border-color: #c4e2cd; }
.card.praise .card-title { color: var(--green); }
.card.tip { background: var(--amber-soft); border-color: #f2cfae; }
.card.tip .card-title { color: #9a4b12; }
.err-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.err-topic { display: inline-block; font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-2); background: var(--teal-soft); border-radius: 999px; padding: 2px 9px; margin-bottom: 8px; }
.err-said { color: var(--red); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.err-said::before { content: "Du: "; text-decoration: none; display: inline-block; font-weight: 700; margin-right: 2px; }
.err-right { color: var(--green); font-weight: 650; margin-top: 4px; }
.err-right::before { content: "Besser: "; font-weight: 750; }
.err-why { color: var(--muted); font-size: .9rem; margin-top: 6px; }
#fb-einschaetzung { margin: 8px 0 4px; }

/* Settings */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin: 10px 0; }
.field input[type="text"], .field input[type="time"], .field select { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 500; }
.field input[type="range"] { accent-color: var(--teal); }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; font-weight: 600; margin: 6px 0; }
.switch-row input { width: 24px; height: 24px; accent-color: var(--teal); flex: none; }
#reminder-details { margin-top: 6px; }
#reminder-details .btn { margin-top: 12px; }
.card .btn.ghost.small { margin: 4px 6px 4px 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: .92rem; max-width: 90vw; z-index: 50; box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); }

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

/* Aufgabenblatt (wie das Papier im Test) */
.aufgabe { display: block; margin: 8px 0; padding: 12px 14px; border-radius: 12px; background: #fff; border: 2px solid var(--amber); white-space: pre-line; font-weight: 550; filter: none !important; }
.aufgabe .ab-label { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #9a4b12; margin-bottom: 6px; }

/* Übersetzung */
.ue { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: #3d4a48; font-size: .95rem; }
.ue[dir="rtl"] { text-align: right; font-size: 1.02rem; line-height: 1.7; font-family: "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, system-ui, sans-serif; }
.err-card .ue { font-weight: 500; }

/* Quellen */
.sources { margin-top: 22px; }
.source-list { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.source-list a { color: var(--teal); font-weight: 600; }
.mic-btn.waiting { animation: pulse 1.8s ease-in-out infinite; }

/* Festes Aufgabenblatt im Training */
.task-sheet { flex: none; background: #fff; border: 2px solid var(--amber); border-radius: 16px; padding: 10px 14px; margin: 4px 0 6px; max-height: 38vh; overflow-y: auto; }
.ts-head { display: flex; justify-content: space-between; align-items: center; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #9a4b12; }
.ts-toggle { font-size: .78rem; font-weight: 700; color: var(--teal); text-transform: none; letter-spacing: 0; padding: 4px 6px; }
.ts-body { white-space: pre-line; font-weight: 600; font-size: 1.02rem; margin-top: 6px; line-height: 1.5; }
.task-sheet.collapsed .ts-body { display: none; }
.session.has-sheet .stage { padding: 6px 0 2px; flex-direction: row; justify-content: center; gap: 14px; }
.session.has-sheet .orb { width: 74px; height: 74px; }
.session.has-sheet .orb-core { width: 58px; height: 58px; }
.session.has-sheet .ring { inset: 8px; }
.session.has-sheet .bars { height: 22px; gap: 3px; }
.session.has-sheet .bars i { width: 4px; }
.session.has-sheet .state-label { margin-top: 0; }
.session.has-sheet .live-text { display: none; }
.session.has-sheet .stage-text { text-align: left; }

/* ---------- Katzen ---------- */
body {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23e7dcc8' fill-opacity='.55'%3E%3Cg transform='translate(18 22) rotate(-18)'%3E%3Cellipse cx='12' cy='16' rx='5.5' ry='4.6'/%3E%3Cellipse cx='5.5' cy='10' rx='2.4' ry='3'/%3E%3Cellipse cx='9.5' cy='6' rx='2.4' ry='3'/%3E%3Cellipse cx='14.5' cy='6' rx='2.4' ry='3'/%3E%3Cellipse cx='18.5' cy='10' rx='2.4' ry='3'/%3E%3C/g%3E%3Cg transform='translate(100 96) rotate(14)'%3E%3Cellipse cx='12' cy='16' rx='5.5' ry='4.6'/%3E%3Cellipse cx='5.5' cy='10' rx='2.4' ry='3'/%3E%3Cellipse cx='9.5' cy='6' rx='2.4' ry='3'/%3E%3Cellipse cx='14.5' cy='6' rx='2.4' ry='3'/%3E%3Cellipse cx='18.5' cy='10' rx='2.4' ry='3'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: -6px 0 12px; }
.hero-cat { width: 118px; height: 125px; flex: none; animation: sway 4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sway { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.speech-bubble { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px; font-weight: 650; color: var(--ink); font-size: .98rem; margin-bottom: 40px; box-shadow: 0 6px 16px -10px rgba(0,0,0,.25); }
.speech-bubble::after { content: ""; position: absolute; right: -10px; bottom: 16px; width: 16px; height: 16px; background: #fff; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(-45deg); }
.speech-bubble.left::after { right: auto; left: -10px; transform: rotate(135deg); }

.start-btn { position: relative; overflow: visible; margin-top: 46px; }
.peek-cat { position: absolute; top: -40px; right: 26px; width: 96px; height: 50px; pointer-events: none; }
.start-btn:active .peek-cat { transform: translateY(4px); }

.week .d i { width: 24px; height: 24px; background: none !important; display: grid; place-items: center; }
.week .d i svg { width: 22px; height: 22px; fill: var(--line); }
.week .d.on i svg { fill: var(--amber); }

/* Katzengesicht im Training */
.orb-core { background: var(--teal-soft) !important; overflow: visible; }
.orb[data-state="listening"] .orb-core { background: var(--amber-soft) !important; }
.orb[data-state="idle"] .orb-core, .orb[data-state="paused"] .orb-core { background: #e9e3d8 !important; }
.cat-face { width: 118%; height: 118%; margin-top: -14%; overflow: visible; }
.cat-face .fur { fill: #F2A65A; }
.cat-face .inner { fill: #F6B5AE; }
.cat-face .stripe { stroke: #D9822B; stroke-width: 4; stroke-linecap: round; fill: none; }
.cat-face .cheek { fill: #F6B5AE; opacity: .6; }
.cat-face .eye { fill: #2a2f2e; }
.cat-face .shine { fill: #fff; }
.cat-face .line { stroke: #2a2f2e; stroke-width: 2.6; fill: none; stroke-linecap: round; }
.cat-face .nose { fill: #E57373; }
.cat-face .whisker { stroke: #2a2f2e; stroke-width: 1.6; stroke-linecap: round; opacity: .6; }
.cat-face .mouth-open { fill: #7a2e2e; display: none; transform-box: fill-box; transform-origin: center; }
.cat-face .eyes-closed { display: none; }
.cat-face .eyes-open { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.cat-face .ear { transform-box: fill-box; }
.cat-face .ear-l { transform-origin: 80% 100%; }
.cat-face .ear-r { transform-origin: 20% 100%; }

.orb[data-state="speaking"] .mouth-open { display: block; animation: talk .32s ease-in-out infinite alternate; }
.orb[data-state="speaking"] .mouth-closed { display: none; }
@keyframes talk { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.orb[data-state="listening"] .ear-l { animation: earL 1.6s ease-in-out infinite; }
.orb[data-state="listening"] .ear-r { animation: earR 1.6s ease-in-out infinite .2s; }
@keyframes earL { 0%,70%,100% { transform: rotate(0); } 80% { transform: rotate(-12deg); } }
@keyframes earR { 0%,70%,100% { transform: rotate(0); } 80% { transform: rotate(12deg); } }
.orb[data-state="thinking"] .eyes-open, .orb[data-state="paused"] .eyes-open { display: none; }
.orb[data-state="thinking"] .eyes-closed, .orb[data-state="paused"] .eyes-closed { display: block; }
.orb[data-state="thinking"] .cat-face { animation: tilt 1.6s ease-in-out infinite; }
@keyframes tilt { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.orb[data-state="thinking"] .orb-core { animation: none; }

/* schlafende Katze beim Auswerten */
.sleep-wrap { position: relative; width: 190px; height: 120px; }
.sleep-cat { width: 190px; height: 120px; animation: breathe 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.zzz { position: absolute; left: 34px; top: 10px; font-family: Georgia, serif; font-weight: 700; color: var(--teal-2); font-size: 1.1rem; opacity: 0; animation: zzz 3s ease-in infinite; }
.zzz.z2 { animation-delay: 1s; font-size: 1.3rem; }
.zzz.z3 { animation-delay: 2s; font-size: 1.6rem; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-26px, -40px); } }

/* Auswertung */
.fb-hero { display: flex; align-items: flex-end; gap: 6px; margin: -6px 0 10px; }
.fb-cat { width: 96px; height: 102px; flex: none; animation: hop 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes hop { 0%,80%,100% { transform: translateY(0); } 88% { transform: translateY(-8px); } }
.fb-hero .speech-bubble { margin-bottom: 30px; }

/* Aussprache */
.practice-wrap { margin-top: 6px; }
.practice-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.practice-card.recording { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.pr-sentence { font-weight: 650; font-size: 1.02rem; }
.pr-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pr-result { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.stars { font-size: 1.35rem; letter-spacing: 2px; color: var(--amber); }
.stars .off { color: var(--line); }
.pr-heard { color: var(--muted); font-size: .9rem; margin: 4px 0 8px; }
.pr-problem { margin: 8px 0; padding: 8px 10px; background: var(--amber-soft); border-radius: 12px; }
.pr-problem b { color: #7a3c10; }
.aus-item { margin: 6px 0 10px; }
.aus-item b { color: var(--teal); }

/* ---------- Fotos der eigenen Katzen ---------- */
.cat-logo { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 10px 24px -12px rgba(0,0,0,.4); }
.hero-photo { width: 132px; height: 116px; object-fit: cover; border-radius: 22px; border: 4px solid #fff; box-shadow: 0 12px 26px -14px rgba(0,0,0,.45); transform: rotate(3deg); flex: none; animation: sway 5s ease-in-out infinite; transform-origin: 50% 100%; }
.hero .speech-bubble { margin-bottom: 26px; }
.peek-photo { position: absolute; top: -34px; right: 24px; width: 66px; height: 66px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 8px 18px -8px rgba(0,0,0,.5); pointer-events: none; transition: transform .2s; }
.start-btn:active .peek-photo { transform: translateY(6px) rotate(-6deg); }
.start-btn { margin-top: 34px; }

.orb-core { background: transparent !important; position: relative; }
.orb-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 10px 26px -10px rgba(20,82,79,.6); transition: filter .3s, transform .3s; }
.orb[data-state="speaking"] .orb-photo { animation: speak 0.9s ease-in-out infinite; }
@keyframes speak { 0%,100% { transform: scale(1); } 30% { transform: scale(1.06) rotate(-2deg); } 60% { transform: scale(.98) rotate(2deg); } }
.orb[data-state="speaking"] .ring { border-color: var(--teal-2); animation: ripple 1.8s ease-out infinite; }
.orb[data-state="speaking"] .r2 { animation-delay: .6s; }
.orb[data-state="speaking"] .r3 { animation-delay: 1.2s; }
.orb[data-state="listening"] .orb-photo { border-color: var(--amber); transform: rotate(-4deg); }
.orb[data-state="thinking"] .orb-photo { filter: saturate(.7); animation: tilt 1.6s ease-in-out infinite; }
.orb[data-state="idle"] .orb-photo, .orb[data-state="paused"] .orb-photo { filter: grayscale(.5) brightness(.95); }
.think-dots { display: none; position: absolute; right: -14px; top: -6px; background: #fff; border-radius: 14px; padding: 5px 8px; gap: 4px; box-shadow: 0 4px 10px -4px rgba(0,0,0,.3); }
.think-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: dot 1.2s ease-in-out infinite; display: block; }
.think-dots i:nth-child(2) { animation-delay: .2s; }
.think-dots i:nth-child(3) { animation-delay: .4s; }
.orb[data-state="thinking"] .think-dots { display: flex; }
.session.has-sheet .orb-photo { border-width: 3px; }
.session.has-sheet .think-dots { right: -20px; top: -10px; transform: scale(.8); }

.sleep-wrap { width: 200px; height: 200px; }
.sleep-photo { width: 200px; height: 200px; object-fit: cover; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 12px 28px -14px rgba(0,0,0,.45); animation: breathe 2.6s ease-in-out infinite; }
.zzz { left: auto; right: 10px; top: 0; color: var(--teal); text-shadow: 0 0 6px #fff; }

.fb-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 10px 22px -12px rgba(0,0,0,.45); flex: none; animation: hop 2.4s ease-in-out infinite; }
/* ---------- Sprechende Katzen (Foto-Puppe) ---------- */
.puppet { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 4px solid #fff; box-shadow: 0 10px 26px -10px rgba(20,82,79,.6); background: #ddd; --open: 0; }
.pp-head { position: absolute; inset: 0; transform: scale(1.08); transform-origin: 50% 75%; transition: transform .25s ease; }
.pp-base, .pp-jaw { position: absolute; inset: 0; width: 100%; height: 100%; }
.pp-base { object-fit: cover; display: block; }
.pp-jaw {
  background-size: 100% 100%;
  -webkit-mask-image: radial-gradient(ellipse var(--jw) var(--jh) at var(--jx) var(--jy), #000 45%, transparent 100%), linear-gradient(to bottom, transparent var(--my), #000 calc(var(--my) + 1.5%));
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(ellipse var(--jw) var(--jh) at var(--jx) var(--jy), #000 45%, transparent 100%), linear-gradient(to bottom, transparent var(--my), #000 calc(var(--my) + 1.5%));
  mask-composite: intersect;
  transform: translate(calc(var(--open) * var(--jdx)), calc(var(--open) * var(--jdy)));
  will-change: transform;
}
.pp-mouth {
  position: absolute; left: calc(var(--mx) - var(--mw) / 2); top: calc(var(--my) - 0.8%); width: var(--mw);
  height: calc(var(--open) * var(--jdy) * 1.15 + 1%);
  border-radius: 45% 45% 50% 50% / 35% 35% 65% 65%;
  background:
    radial-gradient(ellipse 34% 30% at 50% 88%, #c9707a 0 55%, rgba(201,112,122,0) 100%),
    radial-gradient(ellipse 58% 62% at 50% 45%, #170405 0 45%, #3a0c10 72%, rgba(58,12,16,0) 100%);
  transform: rotate(var(--mr, 0deg)); transform-origin: 50% 0;
  opacity: min(1, calc(var(--open) * 4));
  filter: blur(.6px);
}
/* Augenlider: Fell von oberhalb des Auges wird über das Auge geblendet */
.pp-lid {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background-size: 100% 100%;
  opacity: 0; transition: opacity .05s linear;
}
.pp-lid.l {
  transform: translateY(var(--lsh));
  -webkit-mask-image: radial-gradient(ellipse calc(var(--lrx) * 1.45) calc(var(--lry) * 1.45) at var(--lx) calc(var(--ly) - var(--lsh)), #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse calc(var(--lrx) * 1.45) calc(var(--lry) * 1.45) at var(--lx) calc(var(--ly) - var(--lsh)), #000 62%, transparent 100%);
}
.pp-lid.r {
  transform: translateY(var(--rsh));
  -webkit-mask-image: radial-gradient(ellipse calc(var(--rrx) * 1.45) calc(var(--rry) * 1.45) at var(--rx) calc(var(--ry) - var(--rsh)), #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse calc(var(--rrx) * 1.45) calc(var(--rry) * 1.45) at var(--rx) calc(var(--ry) - var(--rsh)), #000 62%, transparent 100%);
}
.puppet.blink .pp-lid { opacity: 1; }
.puppet.talking .pp-head { animation: pp-bob 1.1s ease-in-out infinite; }
@keyframes pp-bob { 0%,100% { transform: scale(1.08) rotate(0) translateY(0); } 25% { transform: scale(1.09) rotate(-2.2deg) translateY(-1%); } 60% { transform: scale(1.08) rotate(1.8deg) translateY(.5%); } }
.puppet.listening .pp-head { transform: scale(1.1) rotate(-5deg); }
.puppet.thinking .pp-head { animation: pp-think 2.2s ease-in-out infinite; }
@keyframes pp-think { 0%,100% { transform: scale(1.08) rotate(6deg) translateY(-1%); } 50% { transform: scale(1.08) rotate(3deg) translateY(-2%); } }
.puppet.sleepy .pp-head { filter: grayscale(.45) brightness(.95); }
@media (prefers-reduced-motion: reduce) { .puppet .pp-head { animation: none !important; } }
.orb-core .puppet { width: 100%; height: 100%; }
.session.has-sheet .orb-core .puppet { border-width: 3px; }
.hero-puppet { width: 128px; height: 128px; flex: none; cursor: pointer; }
.hero-puppet .puppet { box-shadow: 0 12px 26px -14px rgba(0,0,0,.45); }
.fb-puppet { width: 100px; height: 100px; flex: none; }
.tap-hint { display: block; font-size: .72rem; color: var(--teal-2); font-weight: 700; text-align: center; margin-top: 4px; }
.hero-cat-wrap { display: flex; flex-direction: column; align-items: center; flex: none; }

/* ---------- Aufgabenblatt zum Antippen ---------- */
.ts-body { white-space: normal; }
.ts-read { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--amber-soft); color: #7a3c10; font-size: .85rem; font-weight: 700; }
.sh-skip { margin-left: auto; color: var(--teal); font-weight: 800; font-size: .85rem; padding: 2px 4px; }
.sh-intro { font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.sh-shared { background: var(--paper); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-weight: 500; font-size: .95rem; }
.sh-shared p { margin: 3px 0; }
.sh-shared b { display: inline-block; width: 20px; color: #9a4b12; }
.sh-q { margin: 8px 0 12px; }
.sh-text { font-weight: 650; margin-bottom: 6px; }
.sh-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; font-size: .8rem; margin-right: 8px; vertical-align: 1px; }
.sh-opts { display: flex; flex-direction: column; gap: 6px; }
.sh-rf .sh-opts, .sh-match .sh-opts { flex-direction: row; flex-wrap: wrap; }
.sh-opt { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 550; font-size: .97rem; transition: background .15s, border-color .15s; }
.sh-rf .sh-opt { width: auto; flex: 1; justify-content: center; }
.sh-match .sh-opt { width: 44px; height: 44px; padding: 0; justify-content: center; font-weight: 800; }
.sh-k { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--line); font-weight: 800; color: var(--teal); }
.sh-opt.chosen { border-color: var(--teal); background: var(--teal-soft); }
.sh-opt.chosen .sh-k { background: var(--teal); border-color: var(--teal); color: #fff; }
.sh-opt.correct { border-color: var(--green); background: var(--green-soft); }
.sh-opt.correct .sh-k { background: var(--green); border-color: var(--green); color: #fff; }
.sh-opt.wrong { border-color: var(--red); background: var(--red-soft); text-decoration: line-through; }
.sh-opt.wrong .sh-k { background: var(--red); border-color: var(--red); color: #fff; }
.submitted .sh-opt { pointer-events: none; }
.sh-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.sh-foot .btn { padding: 10px 18px; }
.sh-score { font-weight: 800; color: var(--green); }
.task-sheet { max-height: 52vh; }
.msg.system.retry { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: var(--red-soft); color: var(--red); border-radius: 14px; padding: 10px 14px; max-width: 92%; }
