.fairy-voice-trigger {
  min-width: 104px;
  min-height: 44px;
  border-color: rgba(185, 161, 211, 0.38);
  color: #54425f;
  background: linear-gradient(135deg, rgba(248, 242, 255, 0.98), rgba(231, 218, 246, 0.92));
  box-shadow: 0 8px 18px rgba(121, 91, 148, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.fairy-voice-trigger:focus-visible,
.fairy-voice-option:focus-visible,
.fairy-voice-panel button:focus-visible {
  outline: 3px solid rgba(190, 158, 224, 0.82);
  outline-offset: 2px;
}

.fairy-voice-dialog {
  width: min(760px, calc(100vw - 28px));
  max-width: none;
  max-height: min(820px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  color: #4f4359;
  background: transparent;
  box-shadow: 0 24px 70px rgba(56, 42, 68, 0.28);
}

.fairy-voice-dialog::backdrop {
  background: rgba(43, 34, 50, 0.38);
  backdrop-filter: blur(4px);
}

.fairy-voice-panel {
  display: flex;
  max-height: min(820px, calc(100dvh - 28px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(192, 169, 213, 0.42);
  border-radius: inherit;
  background: linear-gradient(155deg, rgba(255, 253, 249, 0.99), rgba(246, 239, 252, 0.99));
}

.fairy-voice-panel__header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 18px 12px 22px;
  border-bottom: 1px solid rgba(185, 161, 211, 0.24);
}

.fairy-voice-panel__header p,
.fairy-voice-panel__header h2,
.fairy-voice-panel__intro,
.fairy-voice-detail p,
.fairy-voice-detail h3 {
  margin: 0;
}

.fairy-voice-panel__header p {
  color: #8a719d;
  font-size: 0.76rem;
  font-weight: 760;
}

.fairy-voice-panel__header h2 {
  margin-top: 2px;
  font-size: 1.3rem;
}

.fairy-voice-panel__close,
.fairy-voice-detail__back,
.fairy-voice-detail__retry {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(185, 161, 211, 0.34);
  border-radius: 999px;
  color: #5d4b69;
  background: rgba(250, 246, 255, 0.92);
  cursor: pointer;
}

.fairy-voice-panel__close {
  display: grid;
  padding: 0;
  font-size: 1.55rem;
  line-height: 1;
  place-items: center;
}

.fairy-voice-panel__body,
.fairy-voice-detail {
  min-height: 0;
  padding: 18px 20px 22px;
  overflow: auto;
  overscroll-behavior: contain;
}

.fairy-voice-panel__intro {
  margin-bottom: 14px;
  color: #6d6074;
  font-size: 0.9rem;
}

.fairy-voice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.fairy-voice-option {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  min-height: 108px;
  padding: 10px;
  border: 1px solid rgba(182, 159, 204, 0.3);
  border-radius: 20px;
  color: #4f4359;
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(91, 69, 108, 0.07);
  cursor: pointer;
}

.fairy-voice-option:hover {
  border-color: rgba(171, 137, 202, 0.58);
  background: rgba(255, 255, 255, 0.92);
}

.fairy-voice-option.is-loading {
  cursor: progress;
}

.fairy-voice-option.is-error {
  border-color: rgba(188, 132, 153, 0.5);
}

.fairy-voice-option.is-selected {
  border-color: rgba(169, 126, 207, 0.74);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 225, 250, 0.88));
  box-shadow: 0 9px 24px rgba(128, 88, 159, 0.13);
}

.fairy-voice-option__visual {
  position: relative;
  display: grid;
  width: 74px;
  height: 86px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, #f7f0fb, #eee4f6);
  place-items: center;
}

.fairy-voice-option__visual img,
.fairy-voice-detail__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fairy-voice-option.is-locked .fairy-voice-option__visual img {
  opacity: 0.78;
}

.fairy-voice-neutral-visual {
  color: #a78ac0;
  font-size: 2rem;
}

.fairy-voice-lock-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(167, 133, 199, 0.36);
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(245, 236, 253, 0.94);
  box-shadow: 0 4px 10px rgba(86, 61, 106, 0.12);
  place-items: center;
}

.fairy-voice-option__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-self: center;
}

.fairy-voice-option__copy strong {
  font-size: 0.94rem;
  line-height: 1.3;
}

.fairy-voice-option__copy span {
  margin-top: 4px;
  color: #74677b;
  font-size: 0.76rem;
  line-height: 1.35;
}

.fairy-voice-option__copy small {
  margin-top: 7px;
  color: #87679d;
  font-size: 0.73rem;
  font-weight: 760;
}

.fairy-voice-selected-mark {
  position: absolute;
  right: 10px;
  bottom: 9px;
  display: grid;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  color: #76528f;
  font-size: 0.78rem;
  background: #eadcf6;
  place-items: center;
}

.fairy-voice-live-status {
  min-height: 1.3em;
  margin: 12px 2px 0;
  color: #765c88;
  font-size: 0.8rem;
}

.fairy-voice-detail {
  text-align: center;
}

.fairy-voice-detail__back {
  display: inline-flex;
  width: auto;
  margin-right: auto;
  padding: 0 15px;
  align-items: center;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 760;
}

.fairy-voice-detail__retry {
  display: inline-flex;
  min-width: 112px;
  margin-top: 16px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 760;
}

.fairy-voice-detail__visual {
  position: relative;
  display: grid;
  width: 150px;
  height: 168px;
  margin: 18px auto 14px;
  overflow: hidden;
  border: 1px solid rgba(185, 161, 211, 0.28);
  border-radius: 26px;
  background: linear-gradient(145deg, #f7f0fb, #eee4f6);
  place-items: center;
}

.fairy-voice-detail__visual img {
  opacity: 0.8;
}

.fairy-voice-detail__visual .fairy-voice-lock-badge {
  top: 10px;
  right: 10px;
}

.fairy-voice-detail__eyebrow {
  color: #87679d;
  font-size: 0.78rem;
  font-weight: 800;
}

.fairy-voice-detail h3 {
  margin-top: 5px;
  font-size: 1.25rem;
}

.fairy-voice-detail > p:not(.fairy-voice-detail__eyebrow) {
  margin-top: 8px;
  color: #6f6276;
  line-height: 1.45;
}

.fairy-voice-detail__note {
  font-size: 0.84rem;
}

[data-theme='dark'] .fairy-voice-panel {
  color: #eee7f4;
  border-color: rgba(207, 184, 226, 0.3);
  background: linear-gradient(155deg, rgba(36, 31, 46, 0.99), rgba(49, 39, 62, 0.99));
}

[data-theme='dark'] .fairy-voice-option,
[data-theme='dark'] .fairy-voice-panel button {
  color: #eee7f4;
  border-color: rgba(207, 184, 226, 0.32);
  background-color: rgba(69, 56, 82, 0.92);
}

@media (orientation: portrait) and (max-width: 767px) {
  .fairy-voice-dialog {
    width: 100%;
    max-height: min(86dvh, 780px);
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }

  .fairy-voice-panel {
    max-height: min(86dvh, 780px);
    border-radius: inherit;
  }

  .fairy-voice-panel__header {
    min-height: 70px;
    padding-inline: 18px 12px;
  }

  .fairy-voice-panel__body,
  .fairy-voice-detail {
    padding: 14px 12px max(20px, env(safe-area-inset-bottom));
  }

  .fairy-voice-grid {
    gap: 8px;
  }

  .fairy-voice-option {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
    min-height: 96px;
    padding: 8px;
    border-radius: 17px;
  }

  .fairy-voice-option__visual {
    width: 54px;
    height: 72px;
    border-radius: 13px;
  }

  .fairy-voice-option__copy strong { font-size: 0.79rem; }
  .fairy-voice-option__copy span { font-size: 0.67rem; }
  .fairy-voice-option__copy small { font-size: 0.65rem; }

  .reading-psychology-actions:has(.fairy-voice-trigger) > .psychology-view-button,
  .reading-psychology-actions:has(.fairy-voice-trigger) > .tts-button,
  .reading-psychology-actions:has(.fairy-voice-trigger) > .fairy-voice-trigger {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: 132px;
    padding-inline: 7px;
  }

  .reading-psychology-actions .fairy-voice-trigger strong {
    font-size: clamp(0.68rem, 3vw, 0.82rem);
  }

  .pfv2-result-view-controls:has(.fairy-voice-trigger) .pfv2-result-speech-button {
    flex: 1 1 0;
    min-width: 0;
    max-width: 116px;
  }

  .mind-garden-reading__header-actions:has(.fairy-voice-trigger) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mind-garden-reading__header-actions:has(.fairy-voice-trigger) > button {
    min-width: 0;
    padding-inline: 7px;
    font-size: 0.72rem;
    white-space: normal;
  }
}
