/* HiLearn.app Non-Invasive Plugin Styles (blends seamlessly with ln.hiart.ca) */
.hl-child-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef7fc; border: 1.5px solid #bfe3f2; color: #1d3557;
  padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.hl-child-chip:hover { background: #dff0f9; }
.hl-radio-nav {
  background: #fde4dc !important; color: #b24327 !important; font-weight: 700 !important;
}

/* Asymmetric Bilingual & Adaptive Glossary Bar */
.hl-bi-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(90deg, #eef7fc 0%, #fff8eb 100%);
  border: 1.5px solid #d5e6f2; border-radius: 14px; padding: 10px 14px; margin: 10px 0 12px;
  font-size: 14px;
}
.hl-bi-bar .hl-lv-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hl-lv-btn {
  border: 1.5px solid #cfdce8; background: #fff; color: #1d3557;
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.hl-lv-btn.on { background: #1d3557; border-color: #1d3557; color: #fff; }

/* Adaptive Vocabulary Glosses inside Chinese Text */
.hl-gloss {
  display: inline-flex; align-items: baseline; gap: 3px; cursor: pointer;
  border-radius: 8px; transition: background .15s, transform .08s;
  vertical-align: baseline;
}
.hl-gloss.mode-beginner {
  background: #fff4d1; border: 1px solid #ecc968; padding: 0 6px; margin: 0 2px;
  color: #1d2a3a; font-weight: 700;
}
.hl-gloss.mode-beginner:hover { background: #ffe8a3; }
.hl-gloss-py { font-size: 12px; color: #8c5d0b; font-weight: 600; margin-left: 2px; }
.hl-gloss-ico { font-size: 14px; }

.hl-gloss.mode-intermediate {
  border-bottom: 2px dotted #e76f51; padding: 0 2px; color: inherit;
}
.hl-gloss.mode-intermediate:hover { background: #fde4dc; }

.hl-gloss.mode-advanced {
  border-bottom: 1px dotted transparent;
}
.hl-gloss.mode-advanced:hover { border-bottom-color: #8cc8e4; background: #eef7fc; }

/* Floating Glossary Card Popover */
.hl-pop-backdrop {
  position: fixed; inset: 0; background: rgba(29, 42, 58, .35); z-index: 1200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.hl-pop-card {
  width: min(420px, 100%); background: #fffaf1; border: 2px solid #eadfcf;
  border-radius: 20px; padding: 20px; box-shadow: 0 18px 44px rgba(29, 53, 87, .24);
}
.hl-pop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hl-pop-ico { font-size: 34px; }
.hl-pop-term { font-size: 26px; font-weight: 800; color: #1d3557; }
.hl-pop-py { font-size: 15px; color: #b24327; font-weight: 700; }
.hl-pop-en {
  display: inline-block; background: #d7f2ee; color: #145e56;
  padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; margin-bottom: 10px;
}
.hl-pop-tip {
  background: #fff; border: 1px solid #eadfcf; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; line-height: 1.55; color: #1d2a3a; margin-bottom: 14px;
}

/* Age Band Filter Banner on Museum Lobby */
.hl-filter-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #eef7fc; border: 1.5px solid #bfe3f2; border-radius: 14px;
  padding: 10px 14px; margin: 12px 0; font-size: 14.5px; color: #1d3557;
}
.hl-band-badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: #eef7fc; color: #1d3557; border: 1px solid #bfe3f2;
  margin-left: 6px; vertical-align: middle;
}
.hl-geo-badge {
  display: inline-block; font-size: 11.5px; font-weight: 800; padding: 2px 8px;
  border-radius: 999px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
  margin-left: 6px; vertical-align: middle;
}
.hl-geo-shelf {
  margin: 14px 0 18px; padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(135deg, #fffdf6 0%, #fff4e0 100%);
  border: 2px solid #f5d89e; box-shadow: 0 6px 18px rgba(180, 83, 9, .08);
}
.hl-geo-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.hl-geo-head b { display: block; font-size: 16.5px; color: #1d3557; }
.hl-geo-head small { font-size: 12.5px; color: #6b5a42; }
.hl-geo-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.hl-geo-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: #fff; border: 1.5px solid #eed9b0; border-radius: 14px;
  text-decoration: none; color: inherit; transition: transform .12s, border-color .15s;
}
.hl-geo-card:hover { transform: translateY(-2px); border-color: #e76f51; }
.hl-geo-ico { width: 46px; height: 46px; flex-shrink: 0; display: inline-flex; }
.hl-geo-ico .wbadge-svg { width: 46px; height: 46px; border-radius: 12px; }
.hl-geo-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hl-geo-txt b { font-size: 14.5px; color: #1d3557; line-height: 1.3; }
.hl-geo-txt small { font-size: 12px; color: #5b6b7f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Quick Check Voice Reflection Card */
.hl-reflect {
  margin-top: 16px; padding: 18px; border-radius: 16px;
  background: linear-gradient(135deg, #f3faf9 0%, #fff9ee 100%);
  border: 2px solid #b8e3dc;
}
.hl-reflect-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hl-reflect-head h4 { margin: 0; font-size: 19px; color: #1d3557; }
.hl-reflect-prompt { font-size: 18px; font-weight: 700; color: #1d2a3a; margin: 4px 0 2px; }
.hl-reflect-en { font-size: 14px; color: #5b6b7f; margin-bottom: 10px; }
.hl-reflect-hints { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.hl-reflect-hint {
  background: #fff; border: 1px solid #eadfcf; border-radius: 999px;
  padding: 3px 10px; font-size: 13px; color: #5b6b7f;
}
.hl-rec-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.hl-rec-btn.recording { background: #d62828 !important; border-color: #d62828 !important; color: #fff !important; animation: hlPulse 1.2s infinite; }
@keyframes hlPulse { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
.hl-transcript-box {
  width: 100%; min-height: 76px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid #d5e2df; background: #fff; font: inherit; font-size: 15.5px;
  resize: vertical; margin-bottom: 10px;
}
.hl-saved-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.hl-saved-item {
  background: #fff; border: 1px solid #eadfcf; border-radius: 12px; padding: 10px 12px;
  font-size: 14.5px;
}

/* Unified Bottom Next-Question Bar on Reading Practice (ALWAYS below Voice Reflection!) */
.qnext-bar {
  margin-top: 16px;
}
.qnext-bar #qnext:disabled {
  background: #f5efe6;
  border: 2px dashed #d5c7b2;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 1;
}

/* Follow-Typing Bilingual + Pinyin + Tap-to-Build Escape Ladder */
.rtype-en-sub { display: block; font-size: 12.5px; font-weight: 600; color: #7c5b22; margin-top: 2px; }
.rtype-tgt-txt ruby rt { font-size: 11px; color: #b45309; font-weight: 700; }
.rtype-tgt-tools { display: inline-flex; gap: 6px; align-items: center; flex-shrink: 0; }
.rtype-tools-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.rtype-tile-wrap { margin-top: 8px; }
.rtype-built {
  min-height: 44px; padding: 9px 12px; border-radius: 12px;
  border: 2px dashed #d5c7b2; background: #fff; font-size: 16px; font-weight: 700; color: #1d3557;
  margin-bottom: 8px; line-height: 1.5;
}
.rtype-built.pass { border-style: solid; border-color: #2a9d8f; background: #e8f8f5; color: #145e56; }
.rtype-tile-bank { display: flex; flex-wrap: wrap; gap: 7px; }
.rtype-tile {
  padding: 7px 13px; border-radius: 12px; border: 1.5px solid #cfdce8; background: #fff;
  color: #1d3557; font-size: 15.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 6px rgba(29, 53, 87, .07); transition: transform .08s, border-color .12s;
}
.rtype-tile:hover:not(:disabled) { border-color: #e76f51; transform: translateY(-1px); }
.rtype-tile.used { opacity: .35; cursor: default; }

/* Floating Frameless Scholarly Owl Silhouette Trigger — zero card box, zero text overlap */
main#app { padding-bottom: 112px; }
.hl-tutor-fab {
  position: fixed;
  right: max(14px, calc(50vw - 650px));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 1150;
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0; border: 0; background: transparent; box-shadow: none;
  cursor: pointer;
  filter: drop-shadow(0 8px 16px rgba(29, 53, 87, .26));
  transition: transform .16s ease, filter .16s ease;
  animation: hlOwlBob 3.6s ease-in-out infinite;
}
.hl-tutor-fab:hover {
  transform: translateY(-4px) scale(1.05);
  filter: drop-shadow(0 12px 20px rgba(29, 53, 87, .36));
}
.hl-tutor-avatar { width: 78px; height: 102px; display: inline-flex; flex-shrink: 0; }
.hl-owl-svg { width: 100%; height: 100%; display: block; }
.hl-owl-eyes { transform-origin: 40px 44px; animation: hlOwlBlink 4.6s ease-in-out infinite; }
.hl-owl-spark { animation: hlOwlSpark 2s ease-in-out infinite; }
@keyframes hlOwlBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.12); }
}
@keyframes hlOwlBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes hlOwlSpark {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.hl-tutor-caption {
  font-size: 12.5px; font-weight: 800; color: #1d3557; white-space: nowrap;
  background: rgba(255, 250, 241, .92); padding: 2px 8px; border-radius: 999px;
  border: 1.5px solid #ffd166; line-height: 1.25;
}

.hl-tutor-panel {
  position: fixed;
  right: max(16px, calc(50vw - 620px));
  bottom: 148px;
  z-index: 1160;
  width: min(430px, calc(100vw - 24px)); max-height: min(72vh, 560px); overflow-y: auto;
  background: #fffaf1; border: 2.5px solid #d5e4f0; border-radius: 22px;
  padding: 16px; box-shadow: 0 20px 50px rgba(29, 53, 87, .28);
  display: flex; flex-direction: column; gap: 11px;
}
.hl-tutor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hl-tutor-head-left { display: flex; align-items: center; gap: 10px; }
.hl-tutor-head-ico { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; }
.hl-tutor-head b { display: block; font-size: 17px; color: #1d3557; }
.hl-tutor-head small { display: block; font-size: 12px; color: #5b6b7f; margin-top: 2px; font-weight: 600; }
.hl-tutor-close {
  border: 1px solid #eadfcf; background: #fff; color: #5b6b7f; border-radius: 999px;
  width: 32px; height: 32px; cursor: pointer; font-weight: 800; flex-shrink: 0;
}
.hl-tutor-chips { display: flex; flex-direction: column; gap: 6px; }
.hl-tutor-chip {
  border: 1.5px solid #d5e4f0; background: #fff; color: #1d3557; border-radius: 13px;
  padding: 8px 11px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 2px; transition: background .12s, border-color .12s;
}
.hl-tutor-chip:hover { background: #eef7fc; border-color: #1d3557; }
.hl-tc-zh { font-size: 13.5px; font-weight: 800; color: #1d3557; }
.hl-tc-en { font-size: 12px; font-weight: 600; color: #5b6b7f; }
.hl-tutor-answer {
  background: #fff; border: 1.5px solid #bfe3dc; border-radius: 14px; padding: 12px;
}
.hl-tutor-q { font-size: 13px; font-weight: 700; color: #5b6b7f; margin-bottom: 6px; }
.hl-tutor-a { font-size: 15.5px; line-height: 1.6; color: #1d2a3a; font-weight: 600; }
.hl-tutor-input-wrap { display: flex; flex-direction: column; gap: 8px; }
.hl-tutor-row { display: flex; gap: 6px; align-items: center; }
.hl-tutor-inp {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: 12px;
  border: 1.5px solid #d5c7b2; background: #fff; font: inherit; font-size: 14.5px;
}
.hl-tutor-status { font-size: 13px; color: #1d3557; font-weight: 700; text-align: center; }
@media (max-width: 1280px) {
  .hl-tutor-fab { right: 8px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .hl-tutor-avatar { width: 64px; height: 84px; }
  .hl-tutor-panel { right: 12px; bottom: 122px; }
}
@media (max-width: 640px) {
  main#app { padding-bottom: 98px; }
  .hl-tutor-fab { right: 6px; bottom: max(8px, env(safe-area-inset-bottom)); }
  .hl-tutor-avatar { width: 52px; height: 68px; }
  .hl-tutor-caption { font-size: 11px; padding: 1px 6px; }
  .hl-tutor-panel { right: 10px; bottom: 100px; }
}

/* Student Focused 3-Step Mini-Path (replaces 27-col wall on /learn/#/reading & /math) */
.hl-focus-track { display: flex; flex-direction: column; gap: 12px; }
.hl-ft-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hl-ft-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hl-ft-bar { flex: 1 1 180px; height: 9px; background: #efe6d8; border-radius: 999px; overflow: hidden; }
.hl-ft-bar span { display: block; height: 100%; background: #2a9d8f; border-radius: 999px; transition: width .25s ease; }

.hl-mini-path { display: grid; grid-template-columns: 1fr 1.55fr 1fr; gap: 12px; align-items: stretch; }
.hl-mp-step {
  border: 1.5px solid #eadfcf; border-radius: 16px; padding: 12px 14px; background: #fffdf9;
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.hl-mp-step.prev { background: #f2fbf8; border-color: #bfe8df; }
.hl-mp-step.now {
  background: linear-gradient(180deg, #fffdf8 0%, #fff4ec 100%);
  border: 2px solid #e76f51; box-shadow: 0 6px 18px rgba(231, 111, 81, .12);
}
.hl-mp-step.next { background: #f7f9fc; border-style: dashed; border-color: #c8d7e6; }
.hl-mp-tag { font-size: 12px; font-weight: 800; color: #5b6b7f; text-transform: uppercase; letter-spacing: .02em; }
.hl-mp-step.prev .hl-mp-tag { color: #16655c; }
.hl-mp-step.now .hl-mp-tag { color: #c44d30; }
.hl-mp-step b { font-size: 16.5px; color: #1d3557; }
.hl-mp-step small { font-size: 12.5px; color: #5b6b7f; }
.hl-mp-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hl-mp-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px;
  border-radius: 999px; border: 1.5px solid #eadfcf; background: #fff;
  font-size: 13px; font-weight: 700; color: #1d2a3a; cursor: default;
}
button.hl-mp-pill { cursor: pointer; }
button.hl-mp-pill:hover { border-color: #1d3557; }
.hl-mp-pill.done { background: #d7f2ee; border-color: #8fd6ca; color: #145e56; }
.hl-mp-pill.cur { background: #e76f51; border-color: #e76f51; color: #fff; }

.hl-full-map {
  border-top: 1px dashed #eadfcf; padding-top: 10px; margin-top: 2px;
}
.hl-full-map summary {
  cursor: pointer; font-size: 13.5px; font-weight: 700; color: #5b6b7f;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.hl-full-map summary::-webkit-details-marker { display: none; }
.hl-full-map summary:hover { color: #1d3557; }
.hl-full-map-body { margin-top: 10px; }

/* Mobile Responsive Polish for /learn/ (parents checking on phone) */
@media (max-width: 760px) {
  .hl-mini-path { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .topbar {
    flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 12px;
  }
  .topbar nav {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; gap: 4px;
  }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a, .hl-child-chip { flex: 0 0 auto; font-size: 13.5px; }
  .hl-bi-bar, .hl-filter-banner, .hl-reflect { padding: 12px; }
}
