/* All Naturals — "What is …?" glossary hover popovers.
   Brand palette: deep green #2f6b3a, pale #eaf5e7, lime accent #9be06f. */

/* --- the in-text term marker --- */
.an-gloss {
  cursor: help;
  color: inherit;
  border-bottom: 1.5px dotted #4f9d69;
  padding-bottom: 0.5px;
  transition: background-color .18s ease, border-color .18s ease;
  border-radius: 2px;
  white-space: normal;
}
.an-gloss::after {
  content: "?";
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 0.62em;
  line-height: 1;
  color: #2f6b3a;
  background: #eaf5e7;
  border-radius: 50%;
  padding: 0.15em 0.34em;
  margin-left: 0.18em;
  vertical-align: super;
  position: relative;
  top: -0.1em;
  transition: background-color .18s ease, color .18s ease;
}
.an-gloss:hover,
.an-gloss.is-open {
  background: #eaf5e7;
  border-bottom-color: #2f6b3a;
}
.an-gloss:hover::after,
.an-gloss.is-open::after {
  background: #2f6b3a;
  color: #fff;
}

/* --- the floating answer card --- */
.an-gloss-pop {
  position: absolute;
  z-index: 100000;
  width: 330px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #cfe6cf;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(31, 74, 40, 0.22), 0 2px 6px rgba(31, 74, 40, 0.10);
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #263b2b;
  opacity: 0;
  transform: translateY(6px) scale(.98);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
  overflow: hidden;
}
.an-gloss-pop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* little pointer arrow */
.an-gloss-pop::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-left: 1px solid #cfe6cf;
  border-top: 1px solid #cfe6cf;
  transform: rotate(45deg);
  left: var(--arrow-x, 28px);
}
.an-gloss-pop[data-place="below"]::before { top: -8px; }
.an-gloss-pop[data-place="above"]::before {
  bottom: -8px;
  border: none;
  border-right: 1px solid #cfe6cf;
  border-bottom: 1px solid #cfe6cf;
}

/* header — the "AI answer" identity row */
.an-gloss-pop__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px 10px;
  background: linear-gradient(135deg, #f3faf2, #eaf5e7);
  border-bottom: 1px solid #e3f0e2;
}
.an-gloss-pop__avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #6fce7f, #2f6b3a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(47, 107, 58, 0.35);
}
.an-gloss-pop__who {
  font-weight: 700;
  font-size: 13px;
  color: #2f6b3a;
  letter-spacing: .1px;
  line-height: 1.1;
}
.an-gloss-pop__tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: #3c7a49;
  background: #ffffff;
  border: 1px solid #d3e9d3;
  border-radius: 999px;
  padding: 1.5px 7px;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* body */
.an-gloss-pop__body {
  padding: 12px 16px 6px;
}
.an-gloss-pop__q {
  font-size: 15px;
  font-weight: 700;
  color: #234a2c;
  margin: 0 0 7px;
  line-height: 1.3;
}
.an-gloss-pop__a {
  font-size: 13.5px;
  line-height: 1.62;
  color: #3a4a3d;
  margin: 0;
}

/* loading shimmer */
.an-gloss-pop__load span {
  display: block;
  height: 10px;
  border-radius: 5px;
  margin: 7px 0;
  background: linear-gradient(90deg, #eef5ea 25%, #dcecda 37%, #eef5ea 63%);
  background-size: 400% 100%;
  animation: an-gloss-shimmer 1.2s ease infinite;
}
.an-gloss-pop__load span:nth-child(2) { width: 92%; }
.an-gloss-pop__load span:nth-child(3) { width: 78%; }
@keyframes an-gloss-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* footer — ask more */
.an-gloss-pop__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px 13px;
}
.an-gloss-pop__src {
  font-size: 10.5px;
  color: #8aa08e;
  font-style: italic;
}
.an-gloss-pop__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  color: #2f6b3a;
  background: #eaf5e7;
  border: 1px solid #cfe6cf;
  border-radius: 999px;
  padding: 5px 12px;
  transition: background-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.an-gloss-pop__more:hover {
  background: #2f6b3a;
  color: #ffffff;
  border-color: #2f6b3a;
  transform: translateY(-1px);
}
.an-gloss-pop__more:focus-visible {
  outline: 2px solid #2f6b3a;
  outline-offset: 2px;
}

/* --- share / save bar --- */
.an-gloss-pop__share {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 14px 13px;
  border-top: 1px solid #edf4ea;
  background: #fbfdfb;
}
/* on a narrow phone, let "Add to Home Screen" take its own full-width row */
@media (max-width: 400px) {
  .an-gloss-act--save { flex-basis: 100%; }
}
.an-gloss-act {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: 600 11.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #3c7a49;
  background: #ffffff;
  border: 1px solid #d7ebd7;
  border-radius: 10px;
  padding: 8px 6px;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease, transform .1s ease;
  white-space: nowrap;
}
.an-gloss-act svg { flex: 0 0 auto; }
.an-gloss-act:hover { background: #eaf5e7; border-color: #b9dcb9; transform: translateY(-1px); }
.an-gloss-act:active { transform: translateY(0); }
.an-gloss-act:focus-visible { outline: 2px solid #2f6b3a; outline-offset: 2px; }
/* the emphasized "Add to Home Screen" action */
.an-gloss-act--save {
  flex: 1.4 1 auto;
  color: #ffffff;
  background: linear-gradient(135deg, #4f9d69, #2f6b3a);
  border-color: #2f6b3a;
}
.an-gloss-act--save:hover {
  background: linear-gradient(135deg, #58ab73, #276036);
  border-color: #276036;
}

/* --- toast --- */
.an-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: #234a2c;
  color: #eaf5e7;
  font: 600 13.5px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(31, 74, 40, 0.35);
  z-index: 100002;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.an-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- iOS add-to-home-screen sheet --- */
.an-ios-sheet {
  position: fixed;
  inset: 0;
  background: rgba(24, 40, 28, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100003;
  opacity: 0;
  transition: opacity .25s ease;
  padding: 16px;
}
.an-ios-sheet.is-on { opacity: 1; }
.an-ios-card {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  max-width: 380px;
  width: 100%;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(30px);
  transition: transform .28s cubic-bezier(.2,.8,.3,1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.an-ios-sheet.is-on .an-ios-card { transform: translateY(0); }
.an-ios-logo {
  width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #6fce7f, #2f6b3a);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  box-shadow: 0 3px 10px rgba(47,107,58,.35);
}
.an-ios-card h3 { margin: 0 0 8px; font-size: 17px; color: #234a2c; }
.an-ios-card p { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: #3a4a3d; }
.an-ios-ico {
  display: inline-flex; vertical-align: middle;
  background: #eaf5e7; border-radius: 6px; padding: 2px 4px; margin: 0 1px;
}
.an-ios-ok {
  font: 700 15px/1 -apple-system, sans-serif; color: #fff;
  background: linear-gradient(135deg, #4f9d69, #2f6b3a);
  border: none; border-radius: 12px; padding: 13px 22px; width: 100%; cursor: pointer;
}
.an-ios-x {
  position: absolute; top: 10px; right: 12px;
  border: none; background: none; font-size: 26px; line-height: 1; color: #9bb0a0; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .an-gloss-pop, .an-gloss, .an-gloss::after, .an-gloss-pop__more,
  .an-gloss-act, .an-toast, .an-ios-sheet, .an-ios-card { transition: none; }
  .an-gloss-pop__load span { animation: none; }
}
