/* The Pilot, the guide figure of writeitsafe.com (pilot.js). Shared by
   writeitsafe.com and sainaveigel.com (guests from writeitsafe.com only).
   Fixed colours of writeitsafe.com in both themes and on both sites: navy,
   signal red only as bars and light red on navy, steel blue. Not part of
   wis.css or site.css, so the dark-theme script does not touch it. */

@font-face {
  font-family: "Pilot Work Sans";
  src: url("fonts/work-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.pilot {
  --p-navy: #0a2a52;
  --p-navy-deep: #0a1f3d;
  --p-navy-soft: #13396a;
  --p-red: #c8102e;
  --p-red-light: #ff8a8a;
  --p-steel: #2f6fa8;
  --p-steel-light: #9cc2e6;
  --p-on: #e7eef7;
  --p-btn: 4.5rem;
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 60;
  font-family: "Pilot Work Sans", "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--p-on);
  pointer-events: none;
}
.pilot > * { pointer-events: auto; }

/* ---------- Round button with the medallion ---------- */
.pilot__btn {
  position: relative;
  display: block;
  width: var(--p-btn);
  height: var(--p-btn);
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--p-navy);
  box-shadow: 0 0 0 3px #fff, 0 6px 22px rgba(10, 31, 61, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, width 0.25s ease, height 0.25s ease;
}
.pilot__btn img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.pilot__btn:hover { transform: scale(1.05); }
.pilot__btn:focus-visible, .pilot__round:focus-visible, .pilot__link:focus-visible {
  outline: 3px solid var(--p-red);
  outline-offset: 3px;
}
.pilot__flag {
  position: absolute;
  left: -0.2rem;
  bottom: -0.1rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(10, 31, 61, 0.35);
}
.pilot__flag img { display: block; width: 1.05rem; height: 1.05rem; }
.pilot__name {
  position: absolute;
  right: calc(var(--p-btn) + 0.6rem);
  bottom: 1.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--p-navy);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(10, 31, 61, 0.25);
  border-left: 4px solid var(--p-red);
  pointer-events: none;
}
.pilot.is-open .pilot__name, .pilot.is-min .pilot__name { display: none; }

/* Rings while the pilot speaks: three calm pulses, then quiet. */
.pilot__btn::before, .pilot__btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--p-steel);
  opacity: 0;
  pointer-events: none;
}
.pilot.is-speaking .pilot__btn::before { animation: pilot-ring 1.6s ease-out 3; }
.pilot.is-speaking .pilot__btn::after { animation: pilot-ring 1.6s ease-out 0.5s 3; border-color: var(--p-red); }
@keyframes pilot-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ---------- Small round buttons ---------- */
.pilot__round {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 2px solid var(--p-steel-light);
  border-radius: 50%;
  background: var(--p-navy-soft);
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.pilot__round:hover { background: var(--p-steel); }
.pilot__round:disabled { opacity: 0.35; cursor: default; background: var(--p-navy-soft); }
.pilot__min {
  position: absolute;
  top: -0.55rem;
  right: -0.35rem;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.95rem;
  border-width: 1.5px;
  background: var(--p-navy);
}
.pilot.is-open .pilot__min { display: none; }

/* ---------- Minimised: a small round dot ---------- */
.pilot.is-min { --p-btn: 2.6rem; }
.pilot.is-min .pilot__min, .pilot.is-min .pilot__flag { display: none; }
.pilot.is-min .pilot__btn { opacity: 0.85; }
.pilot.is-min .pilot__btn:hover, .pilot.is-min .pilot__btn:focus-visible { opacity: 1; }

/* ---------- Speech bubble with its tail into the button ---------- */
.pilot__bubble {
  position: absolute;
  right: 0;
  bottom: calc(var(--p-btn) + 1.1rem);
  box-sizing: border-box;
  width: min(23rem, calc(100vw - 2rem));
  max-height: calc(100vh - var(--p-btn) - 3rem);
  overflow: auto;
  padding: 1.4rem 1.5rem 1.2rem;
  border-radius: 1.75rem;
  background: var(--p-navy);
  border: 2px solid var(--p-steel);
  box-shadow: 0 14px 40px rgba(10, 31, 61, 0.4);
  transform-origin: calc(100% - var(--p-btn) / 2) calc(100% + 1.1rem);
  animation: pilot-grow 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.15);
}
.pilot__bubble[hidden] { display: none; }
.pilot__bubble::before {
  /* the red bar on the left edge */
  content: "";
  position: absolute;
  left: 0;
  top: 1.6rem;
  bottom: 1.6rem;
  width: 5px;
  border-radius: 0 3px 3px 0;
  background: var(--p-red);
}
@keyframes pilot-grow {
  from { transform: scale(0.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
/* The tail sits outside the scrolling box, on the root. */
.pilot.is-open::after {
  content: "";
  position: absolute;
  right: calc(var(--p-btn) / 2 - 0.9rem);
  bottom: calc(var(--p-btn) - 0.1rem);
  width: 1.8rem;
  height: 1.5rem;
  background: var(--p-navy);
  clip-path: polygon(0 0, 100% 0, 62% 100%);
  border-radius: 0 0 0.4rem 0.4rem;
  pointer-events: none;
}
.pilot__close { position: absolute; top: 0.75rem; right: 0.75rem; width: 2.1rem; height: 2.1rem; }
.pilot__kicker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 2.6rem 0.4rem 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p-steel-light);
}
.pilot__kicker .pilot__flag { position: static; width: 1.4rem; height: 1.4rem; flex: none; box-shadow: none; }
.pilot__kicker .pilot__flag img { width: 0.95rem; height: 0.95rem; }
.pilot__note {
  margin: 0 0 0.8rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--p-navy-soft);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
}
.pilot__count { margin: 0.2rem 0 0.15rem; font-size: 0.78rem; font-weight: 600; color: var(--p-red-light); }
.pilot__title { margin: 0 0 0.45rem; font-size: 1.15rem; font-weight: 650; line-height: 1.25; color: #fff; }
.pilot__text { margin: 0 0 0.8rem; font-size: 0.95rem; }
.pilot__text.is-words span { opacity: 0; animation: pilot-word 0.35s ease forwards; }
@keyframes pilot-word { to { opacity: 1; } }
.pilot__links { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 0.9rem; }
.pilot__links[hidden] { display: none; }
.pilot__link {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  border: 1.5px solid var(--p-steel-light);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.pilot__link:hover { background: var(--p-steel); border-color: var(--p-steel); color: #fff; }
.pilot__nav { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.pilot__dots { display: flex; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.pilot__dots li { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--p-navy-soft); border: 1.5px solid var(--p-steel-light); }
.pilot__dots li.is-on { background: var(--p-red-light); border-color: var(--p-red-light); }
.pilot__sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The place on sainaveigel.com that the guest was sent to. */
.pilot-mark {
  outline: 3px solid #c8102e;
  outline-offset: 6px;
  border-radius: 4px;
  transition: outline-color 0.6s ease;
}

@media (max-width: 40rem) {
  .pilot { --p-btn: 3.6rem; }
  .pilot.is-min { --p-btn: 2.3rem; }
  .pilot__name { display: none; }
  .pilot__bubble { width: calc(100vw - 2rem); padding: 1.2rem 1.2rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pilot__btn, .pilot__bubble { transition: none; animation: none; }
  .pilot__btn::before, .pilot__btn::after { animation: none !important; }
  .pilot__text.is-words span { opacity: 1; animation: none; }
  .pilot-mark { transition: none; }
}

@media print { .pilot { display: none; } }
