/* Isolated pronunciation UI. Never override card/face sizes, article gaps, or 3D transforms. */
.fr-pron-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  color: #326f53;
  background: #f3fbf6;
  border: 1px solid #b9d7c5;
  border-radius: 9px;
  box-shadow: 0 2px 0 rgba(50, 92, 64, 0.1);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.fr-pron-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.fr-pron-button:hover {
  color: #245b41;
  background: #e7f6ec;
}

.fr-pron-button:focus-visible {
  outline: 3px solid #3f936d;
  outline-offset: 2px;
}

.fr-pron-card-button {
  position: absolute;
  top: -8px;
  left: 1px;
  z-index: 4;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 50%;
}

/* Preserve the existing uncertainty badge at the upper left, star at the upper right. */
.card-token.is-uncertain .fr-pron-card-button {
  left: 15px;
}

.fr-pron-favorite-button {
  position: absolute;
  top: 11px;
  right: 51px;
  z-index: 5;
  width: 33px;
  height: 33px;
  min-height: 33px;
  padding: 0;
  background: #f3fbf6;
  border-radius: 10px;
}

.fr-pron-favorite-button .fr-pron-button-label {
  display: none;
}

.fr-pron-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin: 7px 0;
}

.fr-pron-details {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  color: #69766e;
  font-size: 0.69rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.fr-pron-variant {
  font-family: "Charis SIL", "Doulos SIL", "Segoe UI", "Arial", sans-serif;
}

.fr-pron-variant.is-selected {
  color: #326f53;
  font-weight: 700;
}

/* Absolutely positioned IPA cannot contribute to intrinsic 3D card width/height.
   JS hides any IPA that would overlap the old meaning or need truncation. */
.fr-pron-card-ipa,
.fr-pron-favorite-ipa {
  position: absolute;
  bottom: 2px;
  left: 5px;
  right: 5px;
  display: block;
  overflow: hidden;
  color: #61756a;
  font-family: "Charis SIL", "Doulos SIL", "Segoe UI", "Arial", sans-serif;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 11px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.fr-pron-favorite-ipa {
  bottom: 3px;
  left: 16px;
  right: 16px;
  font-size: 10px;
  line-height: 12px;
}

.fr-pron-accent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px 7px;
  color: #69766e;
  font-size: 0.64rem;
  line-height: 1.4;
}

.fr-pron-accent label {
  font-weight: 700;
}

.fr-pron-accent select {
  min-height: 30px;
  max-width: 130px;
  padding: 3px 6px;
  color: #326f53;
  background: #fffdf8;
  border: 1px solid #cbd9cb;
  border-radius: 8px;
  font: inherit;
}

.fr-pron-accent-status {
  flex-basis: 100%;
  text-align: right;
  font-size: 0.58rem;
}

.fr-pron-button.is-pending {
  color: #8a651c;
  background: #fff5d9;
  animation: fr-pron-pulse 1000ms ease-in-out infinite;
}

.fr-pron-button.is-speaking {
  color: #fff;
  background: #3a9369;
  border-color: #2d7754;
  box-shadow: 0 0 0 3px rgba(65, 159, 111, 0.18);
  animation: fr-pron-pulse 850ms ease-in-out infinite;
}

.fr-pron-button.is-error {
  color: #9a5038;
  background: #fff0e9;
  border-color: #dbaa96;
}

.fr-pron-notice {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 600;
  width: max-content;
  max-width: min(90vw, 600px);
  padding: 11px 16px;
  color: #fffdf8;
  background: #334d3e;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  font-size: 0.8rem;
  line-height: 1.6;
  transform: translateX(-50%);
}

.fr-pron-card-ipa[hidden],
.fr-pron-favorite-ipa[hidden],
.fr-pron-notice[hidden],
.drag-ghost .fr-pron-button,
.drag-ghost .fr-pron-card-ipa,
.drag-ghost .fr-pron-favorite-ipa {
  display: none !important;
}

@keyframes fr-pron-pulse {
  50% { box-shadow: 0 0 0 3px rgba(65, 159, 111, 0.22); }
}

@media (max-width: 620px) {
  .fr-pron-accent {
    max-width: 50%;
    margin-left: auto;
  }

  .fr-pron-accent-status {
    max-width: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fr-pron-button { animation: none !important; transition: none; }
}
