/* Horse voice/text mode chooser and lightweight voice chat modal */
.horse-chat-choice-modal,
.horse-voice-modal {
  z-index: 1060;
}

.horse-chat-choice-modal .modal-dialog {
  max-width: 494px;
}

.horse-chat-choice {
  background: #003e3a;
  border: 2px solid #0c9a92;
  border-radius: 24px;
  color: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.43), inset 0 0 38px rgba(0, 22, 20, 0.55);
}

.horse-chat-choice__header {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 1;
}

.horse-voice__header {
  align-items: center;
  background: #032f2c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  justify-content: space-between;
  padding: 18px 24px;
}

.horse-voice__title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.horse-chat-choice__title {
  clip: rect(0, 0, 0, 0);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.horse-chat-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 26px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.horse-chat-choice .horse-chat-close {
  font-size: 38px;
  font-weight: 300;
  height: 36px;
  width: 36px;
}

.horse-chat-choice__body {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 68px 30px 40px;
}

.horse-chat-mode {
  align-items: center;
  aspect-ratio: 1;
  background: #004b47;
  border: 1px solid #138c87;
  border-radius: 20px;
  box-shadow: inset 0 0 25px rgba(0, 24, 22, 0.48), 0 8px 18px rgba(0, 18, 16, 0.26);
  color: #ffbd59;
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 8px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.horse-chat-mode__icon {
  align-items: center;
  background: #00423e;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(255, 181, 74, 0.13), inset 0 0 20px rgba(0, 22, 19, 0.65);
  display: flex;
  height: 85%;
  justify-content: center;
  width: 85%;
}

.horse-chat-mode__bubble {
  border: 4px solid currentColor;
  border-radius: 36%;
  box-shadow: 0 0 11px rgba(255, 176, 65, 0.55);
  height: 62%;
  position: relative;
  width: 78%;
}

.horse-chat-mode__bubble::after {
  background: #00423e;
  border-bottom: 4px solid currentColor;
  border-left: 4px solid currentColor;
  bottom: -8px;
  content: "";
  height: 16px;
  left: 18px;
  position: absolute;
  transform: skew(-15deg) rotate(-12deg);
  width: 16px;
}

.horse-chat-mode__bubble .fa-horse-head {
  display: block;
  font-size: 66px;
  left: 7%;
  line-height: 1;
  position: absolute;
  top: 12%;
  filter: drop-shadow(0 0 8px rgba(255, 178, 64, 0.6));
}

.horse-chat-mode__dots {
  bottom: 6%;
  font-size: 17px;
  letter-spacing: 2px;
  position: absolute;
  right: 1%;
}

.horse-chat-mode__soundwaves {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  filter: drop-shadow(0 0 9px rgba(255, 175, 59, 0.55));
}

.horse-chat-mode__soundwaves .fa-microphone {
  font-size: 91px;
}

.horse-chat-mode__wave,
.horse-chat-mode__wave::before,
.horse-chat-mode__wave::after {
  background: currentColor;
  border-radius: 4px;
  display: block;
  width: 4px;
}

.horse-chat-mode__wave {
  height: 30px;
  position: relative;
}

.horse-chat-mode__wave:last-child {
  transform: scaleX(-1);
}

.horse-chat-mode__wave::before,
.horse-chat-mode__wave::after {
  content: "";
  position: absolute;
}

.horse-chat-mode__wave::before {
  height: 16px;
  left: -10px;
  top: 7px;
}

.horse-chat-mode__wave::after {
  height: 43px;
  right: -10px;
  top: -6px;
}

.horse-chat-mode:hover,
.horse-chat-mode:focus-visible {
  border-color: #ffc56b;
  box-shadow: inset 0 0 25px rgba(0, 24, 22, 0.48), 0 0 16px rgba(255, 181, 74, 0.32);
  outline: 2px solid #ffc56b;
  outline-offset: 3px;
  transform: translateY(-2px);
}

.horse-voice-modal .modal-dialog {
  max-width: min(1120px, calc(100vw - 32px));
}

.horse-voice {
  background: #120f0b;
  border: 1px solid rgba(241, 90, 36, 0.32);
  border-radius: 10px;
  color: #f8f1e8;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.horse-voice__shell {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(320px, 1.04fr) minmax(320px, 0.96fr);
  min-height: 620px;
  padding: 20px;
}

.horse-voice__stage,
.horse-voice__conversation {
  background: #090806;
  border: 1px solid rgba(255, 118, 42, 0.22);
  border-radius: 8px;
}

.horse-voice__stage {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  overflow: hidden;
  position: relative;
}

.horse-voice__live {
  align-items: center;
  background: rgba(0, 0, 0, 0.58);
  border-radius: 16px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  left: 18px;
  padding: 7px 12px;
  position: absolute;
  top: 18px;
  z-index: 2;
}

.horse-voice__live::before {
  background: #f2324d;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(242, 50, 77, 0.16);
  content: "";
  height: 8px;
  width: 8px;
}

.horse-voice__avatar-wrap {
  background: #211b14;
  flex: 1;
  min-height: 390px;
  overflow: hidden;
  position: relative;
}

.horse-voice__avatar,
.horse-voice__avatar-video,
.horse-voice__avatar-canvas,
.horse-voice__state-media {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.horse-voice__avatar-video,
.horse-voice__avatar-canvas,
.horse-voice__state-media {
  background: #000;
  inset: 0;
  position: absolute;
}

.horse-voice__avatar-wrap.has-three-avatar .horse-voice__avatar,
.horse-voice__avatar-wrap.has-three-avatar .horse-voice__state-media,
.horse-voice__avatar-wrap.has-three-avatar .horse-voice__avatar-video,
.horse-voice__avatar-wrap.has-three-avatar .horse-voice__avatar-canvas {
  display: none !important;
}

.horse-three-avatar {
  background-color: #1b120c;
  background-image:
    radial-gradient(circle at 50% 22%, rgba(255, 225, 174, 0.28), transparent 26%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.44), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.46)),
    linear-gradient(180deg, transparent 0 60%, rgba(22, 13, 8, 0.55) 60% 100%),
    repeating-linear-gradient(90deg, #2a1a10 0, #2a1a10 24px, #3a2416 25px, #3a2416 49px),
    linear-gradient(180deg, #4a2f1d 0%, #2b1a11 62%, #1c120c 62%, #0c0907 100%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  inset: 0;
  overflow: hidden;
  position: absolute;
  z-index: 2;
}

.horse-three-avatar::before {
  background:
    linear-gradient(90deg, rgba(112, 70, 39, 0.5) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, transparent 0 60%, rgba(145, 94, 52, 0.46) 60% 62%, transparent 62%),
    repeating-linear-gradient(0deg, transparent 0, transparent 34px, rgba(0, 0, 0, 0.18) 35px, transparent 37px);
  content: "";
  inset: 0;
  opacity: 0.55;
  pointer-events: none;
  position: absolute;
}

.horse-three-avatar::after {
  background:
    linear-gradient(180deg, transparent 0 62%, rgba(105, 66, 35, 0.42) 62%, rgba(36, 22, 13, 0.78) 100%),
    radial-gradient(ellipse at 50% 76%, rgba(148, 95, 48, 0.38), transparent 34%),
    radial-gradient(ellipse at 50% 42%, transparent 42%, rgba(0, 0, 0, 0.48) 100%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.horse-three-avatar.has-custom-stable {
  background-color: #1b120c;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.horse-three-avatar canvas {
  display: block;
  height: 100%;
  position: relative;
  width: 100%;
  z-index: 1;
}

.horse-three-avatar__gate-overlay {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  pointer-events: none;
  position: absolute;
  user-select: none;
  width: 100%;
  z-index: 2;
}

.horse-three-avatar__status {
  bottom: 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  left: 18px;
  position: absolute;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  z-index: 3;
}

.horse-voice__controls {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px 22px;
  text-align: center;
}

.horse-voice__talk {
  background: #f3b24f;
  border: 0;
  border-radius: 999px;
  color: #15100b;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  padding: 14px 26px;
  transition: transform 160ms ease, background 160ms ease;
}

.horse-voice__talk:hover,
.horse-voice__talk:focus {
  background: #ffc468;
  outline: 2px solid rgba(255, 255, 255, 0.34);
  outline-offset: 3px;
  transform: translateY(-1px);
}

.horse-voice__avatar-replay {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(243, 178, 79, 0.55);
  border-radius: 999px;
  color: #f8f1e8;
  cursor: pointer;
  display: none;
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  padding: 7px 13px;
}

.horse-voice__avatar-replay:hover,
.horse-voice__avatar-replay:focus {
  background: rgba(243, 178, 79, 0.18);
  outline: 2px solid rgba(255, 255, 255, 0.28);
  outline-offset: 2px;
}

.horse-voice__hint,
.horse-voice__empty {
  color: rgba(248, 241, 232, 0.72);
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.horse-voice__conversation {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  overflow: hidden;
}

.horse-voice__conversation-head {
  align-items: center;
  border-bottom: 1px solid rgba(255, 118, 42, 0.18);
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.horse-voice__toggle-history {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 13px;
}

.horse-voice__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 18px;
}

.horse-voice-message {
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.42;
  max-width: 84%;
  padding: 12px 14px;
}

.horse-voice-message--user {
  align-self: flex-end;
  background: #3a3026;
  color: #fff;
}

.horse-voice-message--horse {
  align-self: flex-start;
  background: #060504;
  border: 1px solid rgba(255, 118, 42, 0.18);
  color: #f8f1e8;
}

.horse-voice__composer {
  border-top: 1px solid rgba(255, 118, 42, 0.16);
  display: flex;
  gap: 10px;
  padding: 14px 16px;
}

.horse-voice__input {
  background: #070604;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #fff;
  flex: 1;
  min-height: 42px;
  padding: 0 16px;
}

.horse-voice__send {
  background: #9c762d;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-width: 72px;
  padding: 0 18px;
}

.horse-voice.is-history-hidden .horse-voice__messages {
  display: none;
}

.horse-voice.is-history-hidden .horse-voice__conversation {
  justify-content: space-between;
}

@media (max-width: 767px) {
  .horse-chat-choice-modal .modal-dialog,
  .horse-voice-modal .modal-dialog {
    margin: 10px auto;
    max-width: calc(100vw - 20px);
  }

  .horse-chat-choice__body {
    gap: 14px;
    padding: 54px 18px 26px;
  }

  .horse-chat-mode__bubble .fa-horse-head {
    font-size: 48px;
  }

  .horse-chat-mode__soundwaves .fa-microphone {
    font-size: 68px;
  }

  .horse-chat-mode__soundwaves {
    gap: 9px;
  }

  .horse-chat-mode__wave::before {
    left: -8px;
  }

  .horse-chat-mode__wave::after {
    right: -8px;
  }

  .horse-voice__header {
    padding: 14px 16px;
  }

  .horse-voice__shell {
    display: block;
    min-height: auto;
    padding: 14px;
  }

  .horse-voice__stage {
    min-height: 0;
  }

  .horse-voice__avatar-wrap {
    aspect-ratio: 4 / 5;
    min-height: 0;
  }

  .horse-voice__conversation {
    border: 0;
    margin-top: 12px;
    min-height: 0;
  }

  .horse-voice__conversation-head,
  .horse-voice__messages .horse-voice-message:not(:last-child),
  .horse-voice__toggle-history {
    display: none;
  }

  .horse-voice__messages {
    display: flex;
    max-height: 112px;
    overflow: hidden;
    padding: 0 2px 12px;
  }

  .horse-voice-message {
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  .horse-chat-mode__bubble .fa-horse-head {
    font-size: 38px;
    left: 7%;
    top: 6%;
  }

  .horse-chat-mode__dots {
    font-size: 12px;
    letter-spacing: 0;
    right: 4%;
  }

  .horse-chat-mode__soundwaves {
    gap: 5px;
  }

  .horse-chat-mode__wave::before {
    left: -6px;
  }

  .horse-chat-mode__wave::after {
    right: -6px;
  }
}

/* End-of-file priority layer for the final voice-chat presentation. */
#horseVoiceChat .horse-chat-close { background:#f3b24f !important; border:1px solid #ffd98b !important; border-radius:50% !important; color:#17110b !important; height:34px !important; width:34px !important; }
#horseVoiceChat .horse-chat-close svg { fill:none; height:18px; stroke:currentColor; stroke-linecap:round; stroke-width:2; width:18px; }
#horseVoiceChat .horse-voice__stage { position:relative !important; }
#horseVoiceChat .horse-voice__controls { bottom:14px !important; left:14px !important; padding:0 !important; position:absolute !important; z-index:8 !important; }
#horseVoiceChat .horse-voice__controls { align-items:center !important; flex-direction:row !important; gap:8px !important; }
#horseVoiceChat .horse-voice__hint,#horseVoiceChat .horse-voice__status { display:none !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle { align-items:center !important; background:#f3b24f !important; border:1px solid #ffdf97 !important; border-radius:50% !important; display:inline-flex !important; font-size:0 !important; height:44px !important; justify-content:center !important; padding:0 !important; width:44px !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle > .horse-icon { display:block !important; fill:none !important; height:21px !important; stroke:#15100b !important; stroke-linecap:round !important; stroke-linejoin:round !important; stroke-width:1.8 !important; width:21px !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle > .horse-icon--unmuted,#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted > .horse-icon--muted { display:none !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted > .horse-icon--unmuted { display:block !important; }
#horseVoiceChat .horse-voice__conversation-head { justify-content:flex-end !important; min-height:48px !important; }
#horseVoiceChat .horse-voice__toggle-history,#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__toggle-history { align-items:center !important; border:1px solid rgba(243,178,79,.5) !important; border-radius:50% !important; display:inline-flex !important; font-size:0 !important; height:34px !important; justify-content:center !important; min-width:34px !important; padding:0 !important; width:34px !important; }
#horseVoiceChat .horse-voice__toggle-history .horse-icon { display:block !important; fill:none !important; height:18px !important; stroke:#f3b24f !important; stroke-linecap:round !important; stroke-linejoin:round !important; stroke-width:1.8 !important; width:18px !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__shell { display:block !important; position:relative !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__stage { width:100% !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap { height:min(72dvh,680px) !important; width:100% !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation { position:absolute !important; right:12px !important; top:12px !important; width:auto !important; z-index:10 !important; }

/* Final voice-chat controls: icon-only, overlaid, and independent of legacy rules. */
#horseVoiceChat .horse-voice__stage {
  position: relative !important;
}

#horseVoiceChat .horse-voice__controls {
  bottom: 14px !important;
  left: 14px !important;
  padding: 0 !important;
  position: absolute !important;
  z-index: 8 !important;
}

#horseVoiceChat .horse-voice__hint,
#horseVoiceChat .horse-voice__status {
  display: none !important;
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle {
  align-items: center !important;
  background: rgba(243, 178, 79, 0.96) !important;
  border: 1px solid rgba(255, 223, 151, 0.95) !important;
  border-radius: 50% !important;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35) !important;
  display: inline-flex !important;
  font-size: 0 !important;
  height: 44px !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 44px !important;
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle > .horse-icon,
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle[data-muted] > .horse-icon {
  display: block !important;
  fill: none !important;
  height: 21px !important;
  stroke: #15100b !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-width: 1.8 !important;
  width: 21px !important;
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle > .horse-icon--unmuted,
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted > .horse-icon--muted {
  display: none !important;
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted > .horse-icon--unmuted {
  display: block !important;
}

#horseVoiceChat .horse-voice__conversation-head {
  justify-content: flex-end !important;
  min-height: 48px !important;
}

#horseVoiceChat .horse-voice__toggle-history,
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__toggle-history {
  align-items: center !important;
  border: 1px solid rgba(243, 178, 79, 0.5) !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  font-size: 0 !important;
  height: 34px !important;
  justify-content: center !important;
  min-width: 34px !important;
  padding: 0 !important;
  width: 34px !important;
}

#horseVoiceChat .horse-voice__toggle-history .horse-icon {
  display: block !important;
  fill: none !important;
  height: 18px !important;
  stroke: #f3b24f !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-width: 1.8 !important;
  width: 18px !important;
}

/* Keep activity feedback centered and calm; the icon communicates the state. */
#horseVoiceChat .horse-voice__activity {
  bottom: 50% !important;
  left: 50% !important;
  transform: translate(-50%, 50%) !important;
}
#horseVoiceChat .horse-voice__activity-item {
  animation: none !important;
  gap: 0 !important;
  height: 42px !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 42px !important;
}
#horseVoiceChat .horse-voice__activity-item span { display: none !important; }

/* The microphone is a single stateful control. Keep the visible icon tied to
 * the DOM state so older desktop/mobile rules cannot leave both states stale. */
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle[data-muted="true"] > .horse-icon--muted { display: block !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle[data-muted="true"] > .horse-icon--unmuted { display: none !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle[data-muted="false"] > .horse-icon--muted { display: none !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle[data-muted="false"] > .horse-icon--unmuted { display: block !important; }

#horseVoiceChat .horse-chat-close {
  align-items: center !important;
  background: #f3b24f !important;
  border: 1px solid #ffd98b !important;
  border-radius: 50% !important;
  color: #17110b !important;
  display: inline-flex !important;
  height: 34px !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 34px !important;
}
#horseVoiceChat .horse-chat-close svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
  width: 18px;
}
#horseVoiceChat .horse-chat-close:hover { background: #ffc468 !important; transform: translateY(-1px); }

#horseVoiceChat .horse-voice__activity {
  bottom: 14px;
  display: flex;
  left: 68px;
  pointer-events: none;
  position: absolute;
  z-index: 8;
}
#horseVoiceChat .horse-voice__activity-item {
  align-items: center;
  background: rgba(14, 12, 10, 0.82);
  border: 1px solid rgba(243, 178, 79, 0.55);
  border-radius: 999px;
  color: #f3b24f;
  display: none;
  gap: 6px;
  padding: 7px 10px;
}
#horseVoiceChat .horse-voice__activity-item svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 16px; }
#horseVoiceChat .horse-voice__activity-item span { font-size: 11px; font-weight: 700; }
#horseVoiceChat .horse-voice__activity.is-listening .horse-voice__activity-item--user,
#horseVoiceChat .horse-voice__activity.is-speaking .horse-voice__activity-item--horse { display: inline-flex; }
#horseVoiceChat .horse-voice__activity.is-listening .horse-voice__activity-item,
#horseVoiceChat .horse-voice__activity.is-speaking .horse-voice__activity-item { animation: horseVoicePulse 1.15s ease-in-out infinite; }

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__shell { display: block !important; position: relative !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__stage { width: 100% !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap { height: min(72dvh, 680px) !important; width: 100% !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation { position: absolute !important; right: 12px; top: 12px; width: auto !important; z-index: 10; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation-head { min-height: 0 !important; }

@keyframes horseVoicePulse {
  0%, 100% { box-shadow: 0 0 0 rgba(243, 178, 79, 0); transform: scale(1); }
  50% { box-shadow: 0 0 0 5px rgba(243, 178, 79, 0.14); transform: scale(1.04); }
}

#horseVoiceChat .horse-voice__header {
  align-items: center !important;
  background: linear-gradient(180deg, #073d39, #032f2c) !important;
  border-bottom: 1px solid rgba(243, 178, 79, 0.3) !important;
  display: flex !important;
  justify-content: space-between !important;
}
#horseVoiceChat .horse-voice__title { letter-spacing: 0.01em; }
#horseVoiceChat .horse-voice__header { gap: 12px; }
#horseVoiceChat .horse-voice__user { align-items:center; display:inline-flex; gap:7px; margin-left:auto; margin-right:10px; }
#horseVoiceChat .horse-voice__user-avatar { align-items:center; background:#f3b24f; border:1px solid #ffd98b; border-radius:50%; color:#17110b; display:inline-flex; font-size:12px; font-weight:800; height:28px; justify-content:center; width:28px; }
#horseVoiceChat .horse-voice__user-name { color:rgba(248,241,232,.84); font-size:12px; font-weight:700; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle:not(.is-unmuted) { background:#f3b24f !important; }
#horseVoiceChat .horse-voice__toggle-history { background:rgba(3,47,44,.94) !important; }
#horseVoiceChat .horse-voice__toggle-history:hover { background:#f3b24f !important; }
#horseVoiceChat .horse-voice__toggle-history:hover { background:rgba(243,178,79,.18) !important; border-color:#f3b24f !important; }
#horseVoiceChat .horse-voice__conversation-user { align-items:center; color:rgba(248,241,232,.82); display:inline-flex; font-size:12px; font-weight:700; gap:7px; }
#horseVoiceChat .horse-voice__conversation-user .horse-voice__user-avatar { font-size:11px; height:24px; width:24px; }

.horse-voice__status {
  color: rgba(248, 241, 232, 0.78);
  font-size: 12px;
  min-height: 16px;
  margin: 0;
}

.horse-voice.is-starting .horse-voice__live::before,
.horse-voice.is-speaking .horse-voice__live::before {
  animation: horseVoicePulse 1s ease-in-out infinite;
}

.horse-voice.is-error .horse-voice__status {
  color: #ff9b7f;
}

.horse-voice.is-speaking .horse-voice__avatar {
  transform: scale(1.012);
  transition: transform 220ms ease;
}

@keyframes horseVoicePulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.45);
  }
}

.horse-voice__toggle-history {
  min-width: 134px;
}

.horse-voice.is-conversation-hidden .horse-voice__shell {
  grid-template-columns: minmax(320px, 1.04fr) minmax(150px, 0.28fr);
}

.horse-voice.is-conversation-hidden .horse-voice__stage {
  min-height: 0;
}

.horse-voice.is-conversation-hidden .horse-voice__avatar-wrap {
  min-height: 390px;
}

.horse-voice.is-conversation-hidden .horse-voice__conversation {
  align-items: flex-end;
  background: transparent;
  border: 0;
  display: flex;
  justify-content: flex-start;
  min-height: 0;
  overflow: visible;
  width: auto;
  z-index: 3;
}

.horse-voice.is-conversation-hidden .horse-voice__conversation-head {
  border: 0;
  padding: 0;
}

.horse-voice.is-conversation-hidden .horse-voice__conversation-head strong,
.horse-voice.is-conversation-hidden .horse-voice__messages,
.horse-voice.is-conversation-hidden .horse-voice__composer {
  display: none;
}

.horse-voice.is-conversation-hidden .horse-voice__toggle-history {
  background: rgba(243, 178, 79, 0.96);
  color: #15100b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

@media (max-width: 767px) {
  .horse-voice.is-conversation-hidden .horse-voice__conversation {
    display: flex;
  }
}

.horse-voice__conversation {
  max-height: calc(100vh - 170px);
}

.horse-voice__messages {
  min-height: 0;
  scrollbar-color: rgba(243, 178, 79, 0.7) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.horse-voice__messages::-webkit-scrollbar {
  width: 6px;
}

.horse-voice__messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.horse-voice__messages::-webkit-scrollbar-thumb {
  background: rgba(243, 178, 79, 0.75);
  border-radius: 999px;
}

.horse-voice-message__text {
  margin: 0;
}

.horse-voice-message__text + .horse-voice-message__audio {
  margin-top: 10px;
}

.horse-voice-message__audio {
  align-items: center;
  background: rgba(243, 178, 79, 0.95);
  border: 0;
  border-radius: 999px;
  color: #15100b;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
  line-height: 1;
  min-height: 28px;
  min-width: 72px;
  padding: 7px 12px;
}

.horse-voice-message__audio::before {
  content: "\25B6";
  font-size: 10px;
}

@media (min-width: 768px) {
  .horse-voice__shell {
    max-height: calc(100vh - 92px);
  }

  .horse-voice__stage,
  .horse-voice__conversation {
    min-height: 0;
  }
}

@media (max-width: 767px) {
  .horse-voice__messages .horse-voice-message {
    display: none;
  }

  .horse-voice__messages .horse-voice-message.is-latest {
    display: block;
  }

  .horse-voice__messages {
    gap: 8px;
    max-height: 168px;
    overflow-y: auto;
  }
}

.horse-voice-modal {
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.horse-voice-modal .modal-dialog {
  align-items: center;
  display: flex;
  margin: 0 auto;
  max-height: calc(100vh - 28px);
  min-height: 0;
}

.horse-voice {
  max-height: calc(100vh - 28px);
}

.horse-voice__shell {
  max-height: calc(100vh - 92px);
  min-height: 0;
}

.horse-voice__stage,
.horse-voice__conversation {
  max-height: calc(100vh - 132px);
  min-height: 0;
}

.horse-voice__stage {
  justify-content: center;
}

.horse-voice__avatar-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.horse-voice__controls {
  flex: 0 0 auto;
}

.horse-voice.is-conversation-hidden .horse-voice__shell {
  align-items: stretch;
}

.horse-voice.is-conversation-hidden .horse-voice__stage {
  display: flex;
}

.horse-voice.is-conversation-hidden .horse-voice__avatar-wrap {
  min-height: 390px;
}

.horse-voice.is-conversation-hidden .horse-voice__avatar {
  object-position: center center;
}

.horse-voice.is-conversation-hidden .horse-voice__controls {
  align-self: center;
  max-width: 560px;
  width: 100%;
}

.horse-voice-message--thinking {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.horse-voice-message--thinking::before {
  animation: horseVoicePulse 0.8s ease-in-out infinite;
  background: #f3b24f;
  border-radius: 50%;
  content: "";
  height: 8px;
  width: 8px;
}

.horse-voice__composer {
  display: none !important;
}

@media (max-width: 767px) {
  .horse-voice-modal {
    align-items: center;
    overflow-y: auto;
  }

  .horse-voice-modal .modal-dialog,
  .horse-voice {
    max-height: calc(100vh - 20px);
  }

  .horse-voice__shell,
  .horse-voice__stage,
  .horse-voice__conversation {
    max-height: none;
  }
}

/* Final viewport fit overrides for the voice modal. */
#horseVoiceChat.horse-voice-modal {
  align-items: center !important;
  bottom: 0;
  display: none;
  justify-content: center !important;
  left: 0;
  overflow: auto !important;
  padding: 12px;
  position: fixed;
  right: 0;
  top: 0;
}

#horseVoiceChat.horse-voice-modal[style*="display: block"],
#horseVoiceChat.horse-voice-modal[style*="display:block"] {
  display: flex !important;
}

#horseVoiceChat .modal-dialog {
  margin: auto !important;
  max-height: calc(100dvh - 24px) !important;
  max-width: min(1040px, calc(100vw - 24px)) !important;
  width: 100%;
}

#horseVoiceChat .horse-voice {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px) !important;
  width: 100%;
}

#horseVoiceChat .horse-voice__header {
  flex: 0 0 auto;
  min-height: 56px;
  padding: 12px 18px;
  position: relative;
  z-index: 6;
}

#horseVoiceChat .horse-chat-close {
  background: #f3b24f;
  border: 1px solid rgba(255, 216, 133, 0.95);
  border-radius: 50%;
  color: #15100b;
  font-size: 22px;
  height: 30px;
  width: 30px;
}

#horseVoiceChat .horse-chat-close:hover,
#horseVoiceChat .horse-chat-close:focus {
  background: #ffc468;
  outline: 2px solid rgba(255, 255, 255, 0.34);
  outline-offset: 2px;
}

#horseVoiceChat .horse-voice__controls {
  min-height: 0 !important;
  padding: 8px 18px 12px !important;
}

#horseVoiceChat .horse-voice__hint:empty {
  display: none !important;
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle {
  align-items: center;
  border: 1px solid rgba(243, 178, 79, 0.9);
  border-radius: 50%;
  display: inline-flex;
  font-size: 0;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle::before {
  content: none;
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted::before {
  content: none;
}

#horseVoiceChat .horse-voice__avatar-wrap {
  position: relative;
}

#horseVoiceChat .horse-voice__controls {
  bottom: 12px;
  left: 12px;
  padding: 0 !important;
  position: absolute;
  z-index: 5;
}

#horseVoiceChat .horse-voice__status,
#horseVoiceChat .horse-voice__hint {
  display: none !important;
}

#horseVoiceChat .horse-icon {
  fill: none;
  height: 21px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 21px;
}

#horseVoiceChat .horse-icon--unmuted {
  display: none;
}

#horseVoiceChat .horse-voice__mute-toggle.is-unmuted .horse-icon--muted {
  display: none;
}

#horseVoiceChat .horse-voice__mute-toggle.is-unmuted .horse-icon--unmuted {
  display: block;
}

#horseVoiceChat .horse-voice__toggle-history {
  border: 0 !important;
  border-radius: 6px !important;
  font-size: 0 !important;
  height: 34px;
  padding: 0 !important;
  width: 34px;
}

#horseVoiceChat .horse-voice__toggle-history .horse-icon {
  display: block;
  height: 19px;
  width: 19px;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__toggle-history {
  min-width: 34px !important;
  width: 34px !important;
}

#horseVoiceChat .horse-voice__shell {
  flex: 1 1 auto;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.92fr);
  max-height: calc(100dvh - 82px) !important;
  min-height: 0 !important;
  overflow: hidden;
}

#horseVoiceChat .horse-voice__stage,
#horseVoiceChat .horse-voice__conversation {
  max-height: calc(100dvh - 122px) !important;
  min-height: 0 !important;
}

#horseVoiceChat .horse-voice__conversation {
  overflow: hidden;
}

#horseVoiceChat .horse-voice__messages {
  min-height: 0;
  overflow-y: auto !important;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__shell {
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 0.24fr);
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__stage {
  align-items: stretch;
  justify-content: center;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap {
  flex: 1 1 auto;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__controls {
  align-self: center;
  flex: 0 0 auto;
}

@media (max-width: 767px) {
  #horseVoiceChat.horse-voice-modal {
    align-items: center !important;
    padding: 8px;
  }

  #horseVoiceChat .modal-dialog,
  #horseVoiceChat .horse-voice {
    max-height: calc(100dvh - 16px) !important;
    max-width: calc(100vw - 16px) !important;
  }

  #horseVoiceChat .horse-voice__header {
    min-height: 48px;
    padding: 10px 12px;
  }

  #horseVoiceChat .horse-voice__title {
    font-size: 15px;
  }

  #horseVoiceChat .horse-voice__shell {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100dvh - 64px) !important;
    overflow-y: auto;
    padding: 10px;
  }

  #horseVoiceChat .horse-voice__stage {
    flex: 1 1 auto;
    max-height: none !important;
  }

  #horseVoiceChat .horse-voice__avatar-wrap {
    aspect-ratio: 4 / 4.7;
    flex: 0 0 auto;
  }

  #horseVoiceChat .horse-voice__controls {
    padding: 14px 10px;
  }

  #horseVoiceChat .horse-voice__talk {
    max-width: 260px;
    padding: 12px 18px;
    width: 100%;
  }

  #horseVoiceChat .horse-voice__conversation {
    flex: 0 0 auto;
    max-height: 170px !important;
  }
}

/* Mobile voice modal: keep header visible and show only the latest exchange item. */
@media (max-width: 767px) {
  #horseVoiceChat.horse-voice-modal {
    align-items: flex-start !important;
    box-sizing: border-box;
    justify-content: center !important;
    min-height: 100dvh;
    overflow-y: auto;
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)) !important;
  }

  #horseVoiceChat .modal-dialog {
    margin: 0 auto !important;
    max-height: calc(100dvh - 16px) !important;
    width: min(100%, 360px) !important;
  }

  #horseVoiceChat .horse-voice {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    overflow: hidden !important;
  }

  #horseVoiceChat .horse-voice__header {
    flex: 0 0 auto;
    min-height: 50px;
    padding: 10px 12px !important;
    position: relative;
    z-index: 4;
  }

  #horseVoiceChat .horse-chat-close {
    flex: 0 0 34px;
    height: 34px;
    width: 34px;
  }

  #horseVoiceChat .horse-voice__shell {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px !important;
    max-height: none !important;
    min-height: 0;
    overflow: hidden !important;
    padding: 8px !important;
  }

  #horseVoiceChat .horse-voice__stage {
    flex: 1 1 auto;
    min-height: 0 !important;
  }

  #horseVoiceChat .horse-voice__avatar-wrap {
    aspect-ratio: auto !important;
    flex: 1 1 auto;
    min-height: 180px !important;
  }

  #horseVoiceChat .horse-voice__controls {
    flex: 0 0 auto;
    gap: 7px;
    padding: 12px 10px !important;
  }

  #horseVoiceChat .horse-voice__hint {
    font-size: 12px;
    line-height: 1.28;
  }

  #horseVoiceChat .horse-voice__status {
    font-size: 11px;
    line-height: 1.25;
    min-height: 14px;
  }

  #horseVoiceChat .horse-voice__conversation {
    background: transparent;
    border: 0;
    border-radius: 0;
    flex: 0 0 auto;
    max-height: 124px !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  #horseVoiceChat .horse-voice__conversation-head,
  #horseVoiceChat .horse-voice__toggle-history,
  #horseVoiceChat .horse-voice__empty {
    display: none !important;
  }

  #horseVoiceChat .horse-voice__messages {
    display: block;
    max-height: 124px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
  }

  #horseVoiceChat .horse-voice__messages .horse-voice-message {
    display: none !important;
  }

  #horseVoiceChat .horse-voice__messages .horse-voice-message:last-child {
    display: block !important;
    margin: 0 auto !important;
    max-height: 124px;
    max-width: 100% !important;
    overflow-y: auto;
    padding: 10px 12px;
  }

  #horseVoiceChat .horse-voice-message__text {
    margin: 0;
  }

  #horseVoiceChat .horse-voice-message__audio {
    margin-top: 8px;
  }
}

/* Mobile avatar clamp: reserve room for header, controls, and latest message. */
@media (max-width: 767px) {
  #horseVoiceChat.horse-voice-modal {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    padding: 8px !important;
  }

  #horseVoiceChat .modal-dialog {
    height: auto !important;
    margin: 0 auto !important;
    max-height: none !important;
    width: min(100%, 360px) !important;
  }

  #horseVoiceChat .horse-voice {
    height: auto !important;
    max-height: calc(100dvh - 16px) !important;
    overflow-y: auto !important;
  }

  #horseVoiceChat .horse-voice__header {
    min-height: 46px !important;
    padding: 9px 12px !important;
  }

  #horseVoiceChat .horse-voice__title {
    font-size: 14px !important;
    line-height: 1.25;
    padding-right: 8px;
  }

  #horseVoiceChat .horse-voice__shell {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column;
    gap: 8px !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 8px !important;
  }

  #horseVoiceChat .horse-voice__stage {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  #horseVoiceChat .horse-voice__avatar-wrap {
    aspect-ratio: 1 / 1 !important;
    flex: 0 0 auto !important;
    height: clamp(180px, 39dvh, 285px) !important;
    max-height: 285px !important;
    min-height: 180px !important;
  }

  #horseVoiceChat .horse-voice__avatar {
    height: 100% !important;
    object-fit: cover;
    object-position: center center;
    width: 100% !important;
  }

  #horseVoiceChat .horse-voice__live {
    left: 12px;
    top: 12px;
  }

  #horseVoiceChat .horse-voice__controls {
    gap: 6px !important;
    padding: 10px 10px 12px !important;
  }

  #horseVoiceChat .horse-voice__talk {
    font-size: 15px !important;
    line-height: 1.2;
    max-width: 260px;
    min-height: 48px;
    padding: 10px 16px !important;
  }

  #horseVoiceChat .horse-voice__conversation {
    flex: 0 0 auto !important;
    max-height: 112px !important;
  }

  #horseVoiceChat .horse-voice__messages,
  #horseVoiceChat .horse-voice__messages .horse-voice-message:last-child {
    max-height: 112px !important;
  }
}

@media (max-width: 380px) and (max-height: 740px) {
  #horseVoiceChat .horse-voice__avatar-wrap {
    height: clamp(160px, 34dvh, 230px) !important;
    min-height: 160px !important;
  }

  #horseVoiceChat .horse-voice__hint {
    font-size: 11px !important;
  }

  #horseVoiceChat .horse-voice__conversation {
    max-height: 96px !important;
  }

  #horseVoiceChat .horse-voice__messages,
  #horseVoiceChat .horse-voice__messages .horse-voice-message:last-child {
    max-height: 96px !important;
  }
}

/* Final modal header visibility: keep green header and close button inside viewport. */
#horseVoiceChat.horse-voice-modal {
  align-items: flex-start !important;
  bottom: 0 !important;
  box-sizing: border-box;
  display: none;
  justify-content: center !important;
  left: 0 !important;
  overflow-y: auto !important;
  padding: 18px 12px !important;
  position: fixed !important;
  right: 0 !important;
  top: 0 !important;
}

#horseVoiceChat.horse-voice-modal[style*="display: block"],
#horseVoiceChat.horse-voice-modal[style*="display:block"] {
  display: flex !important;
}

#horseVoiceChat .modal-dialog {
  margin: 0 auto !important;
  transform: none !important;
}

#horseVoiceChat .horse-voice {
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

#horseVoiceChat .horse-voice__header {
  background: #032f2c !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-sizing: border-box;
  display: flex !important;
  flex: 0 0 auto !important;
  min-height: 54px !important;
  position: sticky;
  top: 0;
  z-index: 20;
}

#horseVoiceChat .horse-chat-close {
  align-items: center !important;
  background: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  border-radius: 0 !important;
  color: #111 !important;
  display: inline-flex !important;
  flex: 0 0 34px !important;
  font-size: 24px !important;
  font-weight: 800;
  height: 34px !important;
  justify-content: center !important;
  line-height: 1 !important;
  opacity: 1 !important;
  padding: 0 !important;
  position: relative;
  width: 34px !important;
  z-index: 21;
}

@media (max-width: 767px) {
  #horseVoiceChat.horse-voice-modal {
    padding: 8px !important;
  }

  #horseVoiceChat .modal-dialog {
    width: min(100%, 360px) !important;
  }

  #horseVoiceChat .horse-voice {
    max-height: calc(100dvh - 16px) !important;
    overflow-y: auto !important;
  }

  #horseVoiceChat .horse-voice__header {
    min-height: 50px !important;
    padding: 8px 10px !important;
  }

  #horseVoiceChat .horse-voice__shell {
    flex: 0 0 auto !important;
    overflow: visible !important;
  }
}

/* Hide history only. Keep the avatar/video stage visible and sized. */
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__shell {
  display: grid !important;
  gap: 16px !important;
  grid-template-columns: minmax(320px, 1fr) 150px !important;
  overflow: hidden !important;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__stage {
  display: flex !important;
  max-height: calc(100dvh - 122px) !important;
  min-height: 0 !important;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap {
  flex: 1 1 auto !important;
  min-height: 390px !important;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation {
  align-items: flex-start !important;
  background: transparent !important;
  border: 0 !important;
  display: flex !important;
  justify-content: flex-start !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  padding-top: 0 !important;
  position: static !important;
  width: 150px !important;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation-head {
  display: flex !important;
  justify-content: flex-end !important;
  padding: 0 !important;
  width: 100% !important;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation-head strong,
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__messages,
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__composer {
  display: none !important;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__toggle-history {
  display: inline-flex !important;
  min-width: 126px !important;
  white-space: nowrap;
}

@media (max-width: 767px) {
  #horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__shell {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
  }

  #horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap {
    min-height: 180px !important;
  }

  #horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation {
    align-items: flex-end !important;
    display: flex !important;
    max-height: 42px !important;
    width: 100% !important;
  }
}

/* Voice avatar must keep a real stage even when conversation history is short. */
#horseVoiceChat .horse-voice__shell {
  min-height: 520px !important;
}

#horseVoiceChat .horse-voice__stage {
  min-height: 450px !important;
}

#horseVoiceChat .horse-voice__avatar-wrap {
  aspect-ratio: auto !important;
  flex: 1 1 auto !important;
  height: clamp(400px, 52dvh, 560px) !important;
  max-height: none !important;
  min-height: 400px !important;
}

#horseVoiceChat .horse-three-avatar,
#horseVoiceChat .horse-three-avatar canvas {
  min-height: 400px !important;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap {
  min-height: 400px !important;
}

@media (max-width: 767px) {
  #horseVoiceChat .horse-voice__shell {
    min-height: 0 !important;
  }

  #horseVoiceChat .horse-voice__stage {
    min-height: 400px !important;
  }

  #horseVoiceChat .horse-voice__avatar-wrap,
  #horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap {
    height: 400px !important;
    min-height: 400px !important;
  }
}

#horseVoiceChat .horse-chat-close { background:#f3b24f !important; border:1px solid #ffd98b !important; border-radius:50% !important; color:#17110b !important; height:34px !important; width:34px !important; }
#horseVoiceChat .horse-chat-close svg { fill:none; height:18px; stroke:currentColor; stroke-linecap:round; stroke-width:2; width:18px; }
#horseVoiceChat .horse-voice__stage { position:relative !important; }
#horseVoiceChat .horse-voice__controls { bottom:14px !important; left:14px !important; padding:0 !important; position:absolute !important; z-index:8 !important; }
#horseVoiceChat .horse-voice__hint,#horseVoiceChat .horse-voice__status { display:none !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle { align-items:center !important; background:#f3b24f !important; border:1px solid #ffdf97 !important; border-radius:50% !important; display:inline-flex !important; font-size:0 !important; height:44px !important; justify-content:center !important; padding:0 !important; width:44px !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle > .horse-icon { display:block !important; fill:none !important; height:21px !important; stroke:#15100b !important; stroke-linecap:round !important; stroke-linejoin:round !important; stroke-width:1.8 !important; width:21px !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle > .horse-icon--unmuted,#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted > .horse-icon--muted { display:none !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted > .horse-icon--unmuted { display:block !important; }
#horseVoiceChat .horse-voice__conversation-head { justify-content:flex-end !important; min-height:48px !important; }
#horseVoiceChat .horse-voice__toggle-history,#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__toggle-history { align-items:center !important; border:1px solid rgba(243,178,79,.5) !important; border-radius:50% !important; display:inline-flex !important; font-size:0 !important; height:34px !important; justify-content:center !important; min-width:34px !important; padding:0 !important; width:34px !important; }
#horseVoiceChat .horse-voice__toggle-history .horse-icon { display:block !important; fill:none !important; height:18px !important; stroke:#f3b24f !important; stroke-linecap:round !important; stroke-linejoin:round !important; stroke-width:1.8 !important; width:18px !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__shell { display:block !important; position:relative !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__stage { width:100% !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap { height:min(72dvh,680px) !important; width:100% !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation { position:absolute !important; right:12px !important; top:12px !important; width:auto !important; z-index:10 !important; }

/* Final icon controls override legacy desktop and mobile button rules. */
#horseVoiceChat .horse-voice__stage { position: relative !important; }
#horseVoiceChat .horse-voice__controls {
  bottom: 14px !important;
  left: 14px !important;
  padding: 0 !important;
  position: absolute !important;
  z-index: 8 !important;
}
#horseVoiceChat .horse-voice__hint,
#horseVoiceChat .horse-voice__status { display: none !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle {
  align-items: center !important;
  background: rgba(243, 178, 79, 0.96) !important;
  border: 1px solid rgba(255, 223, 151, 0.95) !important;
  border-radius: 50% !important;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35) !important;
  display: inline-flex !important;
  font-size: 0 !important;
  height: 44px !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 44px !important;
}
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle > .horse-icon {
  display: block !important;
  fill: none !important;
  height: 21px !important;
  stroke: #15100b !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-width: 1.8 !important;
  width: 21px !important;
}
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle > .horse-icon--unmuted,
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted > .horse-icon--muted { display: none !important; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle.is-unmuted > .horse-icon--unmuted { display: block !important; }
#horseVoiceChat .horse-voice__conversation-head { justify-content: flex-end !important; min-height: 48px !important; }
#horseVoiceChat .horse-voice__toggle-history,
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__toggle-history {
  align-items: center !important;
  border: 1px solid rgba(243, 178, 79, 0.5) !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  font-size: 0 !important;
  height: 34px !important;
  justify-content: center !important;
  min-width: 34px !important;
  padding: 0 !important;
  width: 34px !important;
}
#horseVoiceChat .horse-voice__toggle-history .horse-icon {
  display: block !important;
  fill: none !important;
  height: 18px !important;
  stroke: #f3b24f !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-width: 1.8 !important;
  width: 18px !important;
}

/* Keep the voice conversation identity and toggle in sync on every viewport. */
#horseVoiceChat .horse-voice__conversation-head {
  display: flex !important;
  flex: 0 0 auto;
  gap: 10px;
  min-width: 0;
  padding: 8px 12px;
}

#horseVoiceChat .horse-voice__username {
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#horseVoiceChat .horse-voice__toggle-history {
  flex: 0 0 34px;
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation,
#horseVoiceChat .horse-voice.is-conversation-toggle-disabled .horse-voice__toggle-history {
  display: none !important;
}

@media (max-width: 767px) {
  #horseVoiceChat .horse-voice__conversation {
    max-height: none !important;
  }
}

#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__activity {
  left: 110px;
}

/* Keep the microphone centered when voice lifecycle updates button text. */
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle {
  position: relative;
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle::before {
  color: #15100b;
  content: "\f131";
  display: block;
  font-family: "Font Awesome 6 Free";
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle[data-muted="false"]::before {
  content: "\f130";
}

/* Keep the 3D horse on a plain dark stage, including while it loads. */
#horseVoiceChat .horse-voice__avatar-wrap,
#horseVoiceChat .horse-three-avatar {
  background: #00000033 !important;
}

#horseVoiceChat .horse-three-avatar::before,
#horseVoiceChat .horse-three-avatar::after,
#horseVoiceChat .horse-three-avatar__gate-overlay {
  display: none;
}

#horseVoiceChat .horse-voice__limit-message {
  background: rgba(18, 26, 28, 0.94);
  border: 1px solid rgba(243, 178, 79, 0.65);
  border-radius: 6px;
  bottom: 14px;
  color: #fff;
  font-size: 13px;
  left: 72px;
  line-height: 1.4;
  margin: 0;
  padding: 9px 12px;
  position: absolute;
  right: 14px;
  z-index: 9;
}

#horseVoiceChat .horse-voice__talk:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Voice lifecycle controls and viewport-safe layout. Scoped to the horse dialogs. */
#horseChatChoice .modal-content.horse-chat-choice {
  background: #003e3a !important;
  border: 2px solid #0c9a92 !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 55px rgba(0, 0, 0, .43), inset 0 0 38px rgba(0, 22, 20, .55) !important;
  color: #fff !important;
  overflow: hidden;
  position: relative;
}
#horseChatChoice .horse-chat-choice__body { background: transparent !important; }
#horseChatChoice .horse-chat-choice__header { position: absolute; right: 12px; top: 10px; z-index: 5; }
#horseChatChoice .horse-chat-close {
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  color: #fff !important;
  display: inline-flex !important;
  font-size: 38px !important;
  height: 36px !important;
  justify-content: center !important;
  line-height: 1 !important;
  opacity: 1 !important;
  padding: 0 !important;
  width: 36px !important;
}
#horseChatChoice .horse-chat-close:hover { color: #ffdf97 !important; }
#horseChatChoice .horse-chat-close:focus-visible { border-radius: 4px; outline: 2px solid #ffdf97; outline-offset: 2px; }
#horseVoiceChat .horse-voice__talk.horse-voice__mute-toggle::before { content: none !important; }
#horseChatChoice .horse-chat-mode { flex-direction: column; gap: 10px; }
#horseChatChoice .horse-chat-mode__icon { height: 75%; width: 85%; }
#horseChatChoice .horse-chat-mode__label { color: #ffcb79; font-size: 16px; font-weight: 700; line-height: 1.3; }
#horseVoiceChat { overflow-y: auto !important; overscroll-behavior: contain; padding: 8px !important; }
#horseVoiceChat .modal-dialog { margin: 12px auto !important; max-width: 1100px !important; width: calc(100% - 16px) !important; }
#horseVoiceChat *, #horseChatChoice * { box-sizing: border-box; }
#horseVoiceChat .modal-content { background: #130f0b !important; display: flex; flex-direction: column; max-height: calc(100dvh - 64px) !important; overflow: hidden; }
#horseVoiceChat .horse-voice__shell { display: grid !important; flex: 1 1 auto !important; gap: 16px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 0 !important; overflow: auto !important; padding: 16px !important; }
#horseVoiceChat .horse-voice__stage, #horseVoiceChat .horse-voice__conversation { min-width: 0; }
#horseVoiceChat .horse-voice__stage, #horseVoiceChat .horse-voice__conversation { height: min(64dvh, calc(100dvh - 160px), 640px) !important; max-height: none !important; min-height: 0 !important; }
#horseVoiceChat .horse-voice__avatar-wrap { height: 100% !important; min-height: 0 !important; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap { height: 100% !important; min-height: 0 !important; }
#horseVoiceChat .horse-three-avatar, #horseVoiceChat .horse-three-avatar canvas { min-height: 0 !important; }
#horseVoiceChat .horse-voice__conversation { display: flex !important; flex-direction: column; overflow: hidden !important; }
#horseVoiceChat .horse-voice__controls { align-items: center; display: flex !important; flex-wrap: wrap; gap: 8px; right: 14px; }
#horseVoiceChat .horse-voice__status { background: rgba(0, 20, 19, .92); border-radius: 5px; color: #fff; display: block !important; flex: 1 0 100%; font-size: 13px; line-height: 1.4; margin: 0; max-height: 4.2em; overflow-y: auto; padding: 6px 8px; }
#horseVoiceChat .horse-voice__status:empty { display: none !important; }
#horseVoiceChat .horse-voice__pause, #horseVoiceChat [data-horse-voice-resume] { background: #f3b24f; border: 1px solid #ffdf97; border-radius: 18px; color: #15100b; cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.3; min-height: 40px; padding: 8px 12px; }
#horseVoiceChat .horse-voice__pause:disabled, #horseVoiceChat .horse-voice-message__audio:disabled { cursor: not-allowed; opacity: .45; }
#horseVoiceChat .horse-voice__pause {
  align-items: center !important;
  background: #f3b24f !important;
  border: 1px solid rgba(255, 223, 151, .95) !important;
  border-radius: 50% !important;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .35) !important;
  color: #15100b !important;
  display: inline-flex !important;
  flex: 0 0 44px;
  font-size: 0 !important;
  height: 44px !important;
  justify-content: center !important;
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  width: 44px !important;
}
#horseVoiceChat .horse-voice__pause .horse-icon { fill: none; height: 21px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 21px; }
#horseVoiceChat .horse-voice__pause .horse-icon--pause { stroke-width: 4; }
#horseVoiceChat .horse-voice__pause .horse-icon--play { display: none; fill: currentColor; }
#horseVoiceChat .horse-voice__pause.is-paused .horse-icon--pause { display: none; }
#horseVoiceChat .horse-voice__pause.is-paused .horse-icon--play { display: block; }
#horseVoiceChat .horse-voice__pause:focus-visible { outline: 2px solid #ffdf97; outline-offset: 3px; }
#horseVoiceChat .horse-voice__recovery { align-items: center; background: #063c38; border-bottom: 1px solid #bd8b42; color: #fff; display: flex; flex: 0 0 auto; gap: 12px; padding: 12px 16px; }
#horseVoiceChat .horse-voice__recovery p { flex: 1; font-size: 14px; line-height: 1.45; margin: 0; }
#horseVoiceChat .horse-voice__recovery button { flex: 0 0 auto; }
#horseVoiceChat [data-horse-voice-recovery][hidden] { display: none !important; }
#horseVoiceChat [data-horse-voice-resume][hidden] { display: none !important; }
#horseVoiceChat .horse-voice__messages { flex: 1; max-height: none !important; min-height: 0 !important; overflow-y: auto; overflow-wrap: anywhere; }
#horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__activity { left: auto; right: 14px; }
@media (max-width: 767px) {
  #horseChatChoice .modal-dialog { margin: 16px auto; max-width: calc(100% - 24px); }
  #horseChatChoice .horse-chat-choice__body { gap: 12px; padding: 58px 16px 24px; }
  #horseChatChoice .horse-chat-mode__label { font-size: 14px; }
  #horseVoiceChat .modal-dialog { margin: 0 auto !important; width: 100% !important; }
  #horseVoiceChat .modal-content { max-height: calc(100dvh - 16px) !important; }
  #horseVoiceChat .horse-voice__header { padding: 10px 12px; }
  #horseVoiceChat .horse-voice__title { font-size: 16px; }
  #horseVoiceChat .horse-voice__shell { display: flex !important; flex-direction: column !important; gap: 12px; overflow-y: auto; padding: 12px !important; }
  #horseVoiceChat .horse-voice__stage { flex: 0 0 auto; height: clamp(170px, 32dvh, 280px) !important; min-height: 0 !important; width: 100% !important; }
  #horseVoiceChat .horse-voice__avatar-wrap, #horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__avatar-wrap { height: 100% !important; min-height: 0 !important; width: 100% !important; }
  #horseVoiceChat .horse-voice__conversation { display: flex !important; flex: 0 0 auto; flex-direction: column; height: clamp(150px, 28dvh, 250px) !important; min-height: 0 !important; width: 100% !important; }
  #horseVoiceChat .horse-voice__messages { flex: 1; max-height: none !important; }
  #horseVoiceChat .horse-voice__controls { bottom: 8px !important; left: 8px !important; right: 8px; }
  #horseVoiceChat .horse-voice__recovery { align-items: flex-start; flex-direction: column; gap: 8px; padding: 10px 12px; }
  #horseVoiceChat .horse-voice.is-conversation-hidden .horse-voice__conversation { display: none !important; }
}
