/* Compact Word Orbit action used in tests and saved histories. */
.orbit-quick-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(252, 211, 77, .35);
  border-radius: 12px;
  color: #fde68a;
  background: rgba(252, 211, 77, .08);
  font: 20px/1 var(--font);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .2s, box-shadow .2s, transform .12s;
}
.orbit-quick-btn:hover {
  background: rgba(252, 211, 77, .16);
  box-shadow: 0 0 14px rgba(252, 211, 77, .3);
  transform: translateY(-1px);
}
.orbit-quick-btn.on {
  background: rgba(252, 211, 77, .2);
  box-shadow: 0 0 12px rgba(252, 211, 77, .3);
}
.orbit-mistake-btn { margin-top: 10px; }
.hrev-q { position: relative; }
.hrev-q .hrev-stem { padding-right: 50px; }
.hrev-stem .orbit-history-btn {
  position: absolute;
  top: 0;
  right: 0;
}

/* The tested word always stays on one line; JavaScript scales only long items. */
#voverlay .vq-wordrow {
  max-width: 100%;
}
#voverlay .vq-wordrow .word {
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
}

/* Each new dialogue keeps the same fast CSS scene system but gets its own palette. */
#a1-overlay .theme-dlg-cafe-lunch { --pl1:#ffb95c; --pl2:#ff715c; --pl3:#673214; --pl-glow:rgba(255,168,80,.6); --pl-edge:rgba(255,205,128,.28); --pl-soft:rgba(255,156,72,.14); }
#a1-overlay .theme-dlg-shop-shoes { --pl1:#65e8ff; --pl2:#8a68ff; --pl3:#182653; --pl-glow:rgba(91,214,255,.58); --pl-edge:rgba(127,215,255,.27); --pl-soft:rgba(86,134,255,.14); }
#a1-overlay .theme-dlg-street-foundphone { --pl1:#4ee3bd; --pl2:#3c82ff; --pl3:#0a3b4e; --pl-glow:rgba(57,224,190,.55); --pl-edge:rgba(106,241,220,.26); --pl-soft:rgba(44,204,190,.13); }
#a1-overlay .theme-dlg-home-guest { --pl1:#ffc27a; --pl2:#d878ff; --pl3:#4d203e; --pl-glow:rgba(255,157,180,.52); --pl-edge:rgba(255,200,184,.25); --pl-soft:rgba(234,108,186,.13); }
#a1-overlay .theme-dlg-school-project { --pl1:#62d8ff; --pl2:#576cff; --pl3:#172a61; --pl-glow:rgba(78,173,255,.58); --pl-edge:rgba(129,201,255,.27); --pl-soft:rgba(79,118,255,.14); }
#a1-overlay .theme-dlg-bus-next { --pl1:#ffdd61; --pl2:#33c6a1; --pl3:#17483e; --pl-glow:rgba(121,226,124,.52); --pl-edge:rgba(216,235,116,.26); --pl-soft:rgba(89,205,139,.13); }
#a1-overlay .theme-dlg-family-picnic { --pl1:#a7e85f; --pl2:#ffb65b; --pl3:#405020; --pl-glow:rgba(183,232,86,.54); --pl-edge:rgba(222,243,147,.26); --pl-soft:rgba(160,220,74,.13); }
#a1-overlay .theme-dlg-doctor-ankle { --pl1:#72e5ed; --pl2:#6d91ff; --pl3:#173755; --pl-glow:rgba(92,215,235,.55); --pl-edge:rgba(139,225,240,.27); --pl-soft:rgba(75,183,224,.13); }
#a1-overlay .theme-dlg-hotel-latecheckout { --pl1:#c698ff; --pl2:#6577ff; --pl3:#2a235b; --pl-glow:rgba(158,113,255,.57); --pl-edge:rgba(198,168,255,.27); --pl-soft:rgba(127,88,235,.14); }
#a1-overlay .theme-dlg-work-lunch { --pl1:#ff9566; --pl2:#6e8cff; --pl3:#372648; --pl-glow:rgba(255,135,99,.52); --pl-edge:rgba(255,179,150,.25); --pl-soft:rgba(224,104,111,.13); }

@media (max-width: 600px) {
  #voverlay.overlay {
    align-items: center;
    padding: 10px;
  }

  #voverlay .modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 22px;
  }

  #voverlay .m-head {
    gap: 9px;
    padding: 14px 15px;
  }

  #voverlay .m-head .l {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  #voverlay .m-head .em {
    flex: 0 0 42px;
    width: 42px;
    font-size: 27px;
  }

  #voverlay .m-head .mno {
    overflow: hidden;
    font-size: 9.5px;
    letter-spacing: .11em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #voverlay .m-head .mt {
    overflow: hidden;
    margin-top: 2px;
    font-size: 18px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #voverlay .m-head > div:last-child {
    flex: 0 0 auto;
    gap: 6px !important;
  }

  #voverlay .accent-toggle {
    min-height: 36px;
    padding: 5px 9px;
  }

  #voverlay .x {
    width: 36px;
    height: 36px;
  }

  #voverlay .m-body {
    padding: 17px 15px;
    overscroll-behavior: contain;
  }

  #voverlay .vq-prog {
    gap: 7px;
    margin-bottom: 15px;
  }

  #voverlay .vq-prog .n {
    font-size: 12px;
  }

  #voverlay .vq-ask {
    margin: 12px 0 19px;
  }

  #voverlay .vq-ask .lab {
    font-size: 10.5px;
    letter-spacing: .11em;
  }

  #voverlay .vq-wordrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 9px auto 0;
  }

  #voverlay .vq-wordrow .word {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 84px);
    overflow: visible;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
    font-size: clamp(25px, 8.5vw, 36px);
    line-height: 1.08;
    text-align: center;
  }

  #voverlay .vq-speak,
  #voverlay .orbit-test-btn {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0;
    border-radius: 10px;
    font-size: 16px;
  }

  #voverlay .vq-opts {
    gap: 8px;
  }

  #voverlay .vq-opt {
    min-height: 50px;
    padding: 13px 14px;
    border-radius: 13px;
    font-size: 16px;
    line-height: 1.35;
  }

  #voverlay .m-foot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 13px;
  }

  #voverlay .m-foot .btn {
    min-width: 0;
    min-height: 46px;
    justify-content: center;
    padding: 11px 9px;
    font-size: 13.5px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  #voverlay .m-foot .btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .orbit-quick-btn {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 10px;
    font-size: 18px;
  }

  .hrev-q .hrev-stem { padding-right: 44px; }
}

@media (max-width: 360px) {
  #voverlay.overlay { padding: 6px; }
  #voverlay .modal { max-height: calc(100dvh - 12px); border-radius: 18px; }
  #voverlay .m-head { padding: 12px; }
  #voverlay .m-head .em { flex-basis: 36px; width: 36px; }
  #voverlay .m-head .mt { max-width: 122px; font-size: 16px; }
  #voverlay .accent-toggle .acc-lab { display: none; }
  #voverlay .accent-toggle { width: 38px; justify-content: center; padding-inline: 0; }
  #voverlay .m-body { padding: 15px 12px; }
  #voverlay .vq-wordrow { gap: 5px; }
  #voverlay .vq-wordrow .word { max-width: calc(100% - 76px); }
  #voverlay .vq-speak,
  #voverlay .orbit-test-btn {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 15px;
  }
  #voverlay .vq-opt { padding: 12px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .orbit-quick-btn { transition:none; }
}
