/* Lola tips design handoff. Load after page CSS; no site/builder changes here. */
.lola-tips {
  --lola-paper: #fffdfa;
  --lola-ink: #292421;
  --lola-line: #e7ded6;
  --lola-accent: #b92d28;
  --lola-mint: #246b59;
  box-sizing: border-box;
  position: fixed;
  z-index: 41; /* below fixed page headers (100) */
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: calc(100vw - 48px);
  color: var(--lola-ink);
  font: 400 15px/1.5 Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.lola-tips *, .lola-tips *::before, .lola-tips *::after { box-sizing: border-box; }
.lola-tips__bubble {
  position: relative;
  width: min(340px, calc(100vw - 168px));
  max-height: min(240px, calc(100dvh - 180px));
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--lola-line);
  border-radius: 16px;
  background: var(--lola-paper);
  box-shadow: 0 12px 34px rgba(41, 36, 33, .16);
}

.lola-tips__header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 8px; }
.lola-tips__header strong { color: var(--lola-mint); font-size: 14px; }
.lola-tips__header span { color: #5e5753; font-size: 12px; }
.lola-tips__text {
  min-height: 3em;
  overflow-wrap: anywhere;
  margin: 0 0 12px;
  color: var(--lola-ink);
  font: inherit;
}
.lola-tips__text.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -.14em;
  background: var(--lola-mint);
}
.lola-tips__announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.lola-tips__controls { display: flex; flex-wrap: wrap; gap: 8px; }
.lola-tips__pause, .lola-tips__close, .lola-tips__restore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--lola-line);
  border-radius: 10px;
  background: #fff;
  color: var(--lola-ink);
  font: 700 13px/1.25 Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}
.lola-tips__pause:hover, .lola-tips__close:hover, .lola-tips__restore:hover {
  border-color: var(--lola-mint);
  background: #eaf5ee;
}
.lola-tips__pause:focus-visible, .lola-tips__close:focus-visible, .lola-tips__restore:focus-visible {
  outline: 3px solid var(--lola-accent);
  outline-offset: 2px;
}
.lola-tips__pause[aria-pressed="true"] { border-color: var(--lola-mint); color: var(--lola-mint); }
.lola-tips__restore { max-width: min(170px, calc(100vw - 100px)); box-shadow: 0 8px 24px rgba(41, 36, 33, .12); }
.lola-tips__mascot {
  display: block;
  flex: none;
  width: 95px;
  height: 95px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.lola-tips[hidden], .lola-tips__bubble[hidden], .lola-tips__restore[hidden] { display: none !important; }
@media (max-width: 600px) {
  .lola-tips {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    max-width: calc(100vw - 24px);
  }
  .lola-tips__mascot { width: 55px; height: 55px; }
  .lola-tips__bubble {
    width: min(248px, calc(100vw - 91px));
    max-height: min(190px, calc(100dvh - 180px));
    padding: 12px;
  }

  .lola-tips__text { font-size: 13px; line-height: 1.4; }
  .lola-tips__pause, .lola-tips__close { padding-inline: 8px; font-size: 12px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .lola-tips__bubble { max-height: calc(100dvh - 130px); }
}
@media (prefers-reduced-motion: reduce) {
  .lola-tips__text.is-typing::after { display: none; }
  .lola-tips, .lola-tips * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Lola speech bubble override: concatenate AFTER design.css. Scoped to the fixed widget. */
.lola-tips {
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.lola-tips__bubble {
  width: min(340px, calc(100vw - 48px - env(safe-area-inset-right, 0px)));
  max-height: min(240px, calc(100dvh - 151px - env(safe-area-inset-bottom, 0px)));
  /* Keep the existing internal scroll; the tail belongs to the root, not this box. */
  overflow-y: auto;
  padding: 16px;
}

/* No controls inside the speech bubble; the image button is the pause control. */
.lola-tips__controls { display: none; }
.lola-tips__text { margin-bottom: 0; }

.lola-tips__speaker {
  display: block;
  flex: none;
  width: 95px;
  height: 95px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.lola-tips__speaker:focus-visible {
  outline: 3px solid var(--lola-accent);
  outline-offset: 2px;
}

/* The root is not scroll-clipped. Base meets the bubble's lower edge;
   the tapered point lands at the visible mouth (~49,37 within the 95px image). */
.lola-tips:has(> .lola-tips__bubble:not([hidden]))::after {
  content: "";
  position: absolute;
  right: 46px;
  bottom: 57px;
  width: 72px;
  height: 46px;
  background: var(--lola-paper);
  clip-path: polygon(0 0, 53% 0, 100% 100%);
  filter: drop-shadow(1px 1px 0 var(--lola-line));
  pointer-events: none;
}

@media (max-width: 600px) {
  .lola-tips { gap: 6px; }
  .lola-tips__bubble {
    width: min(248px, calc(100vw - 24px - env(safe-area-inset-right, 0px)));
    max-height: min(190px, calc(100dvh - 85px - env(safe-area-inset-bottom, 0px)));
    padding: 12px;
  }
  .lola-tips__speaker { width: 55px; height: 55px; }
  .lola-tips:has(> .lola-tips__bubble:not([hidden]))::after {
    right: 27px;
    bottom: 33px;
    width: 43px;
    height: 28px;
  }
}

/* Lola visual polish. Append after design.css and above.css in runtime tips.css. */
.lola-tips {
  --lola-polish-paper: #fffdfa;
  --lola-polish-line: #e6dcd4;
  --lola-polish-ink: #292421;
  isolation: isolate;
}

.lola-tips__bubble {
  z-index: 0;
  max-height: max(48px, min(240px, calc(100dvh - 151px - env(safe-area-inset-bottom, 0px))));
  overflow-y: auto;
  padding: 18px 20px 19px;
  border: 1px solid var(--lola-polish-line);
  border-radius: 18px;
  background: var(--lola-polish-paper);
  box-shadow: inset 2px 0 0 rgba(185, 45, 40, .68), 0 16px 40px rgba(41, 36, 33, .14), 0 3px 9px rgba(41, 36, 33, .06);
  scrollbar-width: thin;
  scrollbar-color: #c9bdb3 transparent;
}

.lola-tips__header {
  align-items: baseline;
  gap: 3px 9px;
  margin-bottom: 10px;
  line-height: 1.3;
}
.lola-tips__header strong {
  color: var(--lola-mint);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.015em;
}
.lola-tips__header span {
  color: #625b56;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
}
.lola-tips__text {
  min-height: 3em;
  margin: 0;
  color: var(--lola-polish-ink);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.005em;
  text-wrap: pretty;
}
.lola-tips__text.is-typing::after { background: var(--lola-accent); }

/* Paint the tail above the bubble shadow but below the face; its base overlaps
   the paper by 2px so no seam opens at the rounded lower edge. */
.lola-tips:has(> .lola-tips__bubble:not([hidden]))::after {
  z-index: 1;
  height: 48px;
  background: var(--lola-polish-paper);
  filter: drop-shadow(0 1px 0 #cdbdb1) drop-shadow(2px 4px 3px rgba(41, 36, 33, .20));
}
.lola-tips__speaker { z-index: 2; }
.lola-tips__speaker:hover { filter: drop-shadow(0 3px 6px rgba(41, 36, 33, .18)); }
.lola-tips__restore {
  border-color: var(--lola-polish-line);
  background: var(--lola-polish-paper);
  box-shadow: 0 10px 26px rgba(41, 36, 33, .13);
}

@media (max-width: 600px) {
  .lola-tips__bubble {
    max-height: max(48px, min(190px, calc(100dvh - 85px - env(safe-area-inset-bottom, 0px))));
    padding: 14px 16px 15px;
    border-radius: 16px;
  }
  .lola-tips__header { gap: 2px 7px; margin-bottom: 7px; }
  .lola-tips__header strong { font-size: 14px; }
  .lola-tips__header span { font-size: 11px; }
  .lola-tips__text { font-size: 13.5px; line-height: 1.5; }
  .lola-tips:has(> .lola-tips__bubble:not([hidden]))::after { height: 30px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .lola-tips__bubble {
    max-height: max(48px, min(240px, calc(100dvh - 151px - env(safe-area-inset-bottom, 0px))));
  }
}
@media (max-width: 600px) and (max-height: 480px) {
  .lola-tips__bubble {
    max-height: max(48px, min(190px, calc(100dvh - 85px - env(safe-area-inset-bottom, 0px))));
  }
}
@media (prefers-reduced-motion: reduce) {
  .lola-tips__speaker:hover { filter: none; }
}
