/* ============================================================
   LOEHR FAMILY SYMBOL STAMP — Loehr Software Suite
   © 2025 Daphne Loehr / The Loehr Family — Est. 2025
   A Division of Ausko LLC. All rights reserved.
   ============================================================
   Little DORA — floating READING BUBBLE (2026-11-19).
   The bubble button, its chat panel, the word card, and the
   tappable sentence/word spans for tap-to-hear reading help.
   Big, round, playful — sized for small fingers. Her color
   wins: Anna's surfaces run blue, Calliope's run pink (the
   body[data-kid] accent the school pages already set). */

:root { --ld-bubble-accent: #ff69b4; }
body[data-kid="anna"] { --ld-bubble-accent: #4da3ff; }
body[data-kid="calliope"] { --ld-bubble-accent: #ff69b4; }

#ldBubbleBtn {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 84px; height: 84px; border-radius: 50%;
  border: 4px solid #fff; cursor: pointer;
  background: radial-gradient(circle at 32% 30%, #ffd3e8, var(--ld-bubble-accent) 72%);
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  font-size: 2rem; line-height: 1; color: #170816;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
}
#ldBubbleBtn .ld-bubble-btn-words { font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
#ldBubbleBtn:active { transform: scale(.96); }

#ldBubblePanel {
  position: fixed; right: 12px; bottom: 112px; z-index: 61;
  width: min(94vw, 400px); max-height: min(74vh, 640px);
  display: flex; flex-direction: column;
  background: #24122c; color: #fff;
  border: 3px solid var(--ld-bubble-accent); border-radius: 24px;
  box-shadow: 0 18px 48px rgba(0,0,0,.55); overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}
#ldBubblePanel[hidden] { display: none !important; }
.ld-bubble-head {
  display: flex; align-items: center; gap: 10px;
  background: var(--ld-bubble-accent); color: #170816;
  padding: 12px 14px; font-weight: 800; font-size: 1.1rem;
}
.ld-bubble-head .ld-bubble-close {
  margin-left: auto; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.85); color: #170816; font-weight: 800;
  padding: 8px 14px; font-size: 1rem; min-height: 44px;
}
.ld-bubble-note { padding: 8px 14px 0; font-size: .92rem; opacity: .85; min-height: 0; }
.ld-bubble-note:empty { display: none; }
.ld-bubble-log { display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 12px 14px; }
.ld-bubble-msg { padding: 11px 13px; border-radius: 16px; line-height: 1.4; font-size: 1.05rem; white-space: pre-wrap; }
.ld-bubble-msg.kid { align-self: flex-end; background: #4b2658; }
.ld-bubble-msg.dora { align-self: flex-start; background: #18381f; }
.ld-bubble-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 10px; }
.ld-bubble-chips button {
  border: 2px solid var(--ld-bubble-accent); background: #2f1a36; color: #fff;
  border-radius: 999px; padding: 10px 14px; font-size: 1rem; font-weight: 700;
  cursor: pointer; min-height: 48px;
}
.ld-bubble-card {
  margin: 0 14px 10px; padding: 12px 14px; border-radius: 18px;
  background: #fff; color: #24122c; border: 3px solid var(--ld-bubble-accent);
}
.ld-bubble-card[hidden] { display: none !important; }
.ld-bubble-card .ld-card-word { font-size: 2rem; font-weight: 900; letter-spacing: .01em; }
.ld-bubble-card .ld-card-chunks { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.ld-bubble-card .ld-chunk {
  background: var(--ld-bubble-accent); color: #170816; font-weight: 800;
  border-radius: 10px; padding: 6px 12px; font-size: 1.25rem;
}
.ld-bubble-card .ld-card-meaning { font-size: 1.02rem; line-height: 1.4; }
.ld-bubble-card .ld-card-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ld-bubble-card .ld-card-row button {
  border: 0; border-radius: 999px; padding: 12px 16px; cursor: pointer;
  background: #24122c; color: #fff; font-weight: 800; font-size: 1rem; min-height: 48px;
}
.ld-bubble-input { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid #5f3c68; }
.ld-bubble-input input {
  flex: 1; min-width: 0; padding: 13px; border-radius: 14px; font-size: 16px;
  border: 1px solid #70477e; background: #0d0810; color: #fff;
}
.ld-bubble-input button {
  border: 0; border-radius: 14px; padding: 12px 16px; cursor: pointer;
  font-size: 1.05rem; font-weight: 800; min-height: 52px;
  background: var(--ld-bubble-accent); color: #170816;
}
.ld-bubble-input button.ld-bubble-mic { background: #2f1a36; color: #fff; border: 2px solid var(--ld-bubble-accent); }
.ld-bubble-input button.ld-bubble-mic.listening { background: #b3123f; color: #fff; }
.ld-bubble-status { padding: 0 14px 10px; font-size: .95rem; opacity: .85; min-height: 1.2em; }
.ld-bubble-status:empty { display: none; }

/* Tap-to-hear reading text: sentences and words inside any
   [data-read-aloud] block become gentle tap targets. */
.ld-sent { border-radius: 8px; }
.ld-word {
  cursor: pointer; border-bottom: 3px dotted var(--ld-bubble-accent);
  border-radius: 4px; padding: 0 1px;
}
.ld-word:active, .ld-sent.ld-hearing { background: rgba(255, 209, 102, .45); }
