/* Annie at Whoever: the written twin of the live employment desk. */
.text-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 72;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 4px 4px 0 var(--marigold);
  font: 600 .92rem/1 var(--sans);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .2s ease;
}
.text-launcher:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--marigold); }
.text-launcher[aria-expanded="true"] { opacity: 0; pointer-events: none; }
@media (max-width: 620px) {
  /* The hero already offers two clear actions. Reveal the floating invitation
     after it has passed rather than covering either button on a small phone. */
  body.hero-in-view .text-launcher { opacity: 0; visibility: hidden; pointer-events: none; }
}
.call-dock.up ~ .text-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}
.text-launcher__dot,
.text-desk__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--kelly);
  box-shadow: 0 0 0 3px rgba(42, 158, 0, .16);
}

.text-desk {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 78;
  width: min(430px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  height: min(720px, calc(100dvh - 40px));
  max-height: min(720px, calc(100dvh - 40px));
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 8px 8px 0 var(--ink);
  font-family: var(--sans);
  opacity: 0;
  transform: translateY(24px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .3s cubic-bezier(.22,.8,.24,1);
}
.text-desk[hidden] { visibility: hidden; }
.text-desk.up { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.text-desk__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1.5px solid var(--ink);
}
.text-desk__head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font: 400 1.55rem/1.1 var(--serif);
}
.text-desk__dot { flex: 0 0 auto; }
.text-desk__close {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: 400 1.45rem/1 var(--sans);
  cursor: pointer;
}
.text-desk__close:hover { background: #fff; }
.text-desk__thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(250,247,239,.96), rgba(250,247,239,.96)),
    linear-gradient(90deg, var(--cobalt) 0 33.3%, var(--pink) 33.3% 66.6%, var(--marigold) 66.6%);
  overscroll-behavior: contain;
}
.text-message {
  width: fit-content;
  max-width: 94%;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 15px;
  font-size: .92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.text-message p { margin: 0; font: inherit; }
.text-message p + p { margin-top: .7em; }
.text-message--streaming > p:last-child::after {
  content: ''; display: inline-block; width: 5px; height: 1em; margin-left: 3px;
  vertical-align: -.1em; background: var(--cobalt); animation: text-cursor .85s ease-in-out infinite;
}
.text-message--incomplete { border-style: dashed; opacity: .65; }
.text-retry { display: block; margin-top: 8px; padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--marigold); color: var(--ink); font: 600 .78rem/1 var(--sans); cursor: pointer; }
.text-desk__announcement { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.text-message--annie { background: #fff; border-bottom-left-radius: 4px; box-shadow: 3px 3px 0 var(--cobalt); }
.text-message--visitor { margin-left: auto; background: var(--pink); border-bottom-right-radius: 4px; }
.text-message--status { border: 0; padding: 2px 4px; color: var(--ink-soft); font-size: .78rem; font-style: italic; }
.text-message--enter {
  opacity: 0;
  transform: translateY(8px) scale(.985);
  transform-origin: bottom left;
  transition: opacity .2s ease, transform .28s cubic-bezier(.2,.75,.25,1);
}
.text-message--visitor.text-message--enter { transform-origin: bottom right; }
.text-message--enter.is-shown { opacity: 1; transform: none; }
.text-message--thinking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 180px;
  min-height: 28px;
  margin-bottom: 12px;
}
.text-thinking-label {
  margin-right: 4px;
  font: 600 .72rem/1.2 var(--sans);
  letter-spacing: .01em;
  transition: opacity .14s ease, transform .14s ease;
}
.text-thinking-label.is-changing { opacity: 0; transform: translateY(3px); }
.text-thinking-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: text-thinking 1.05s ease-in-out infinite;
}
.text-thinking-dot:nth-of-type(2) { animation-delay: .14s; }
.text-thinking-dot:nth-of-type(3) { animation-delay: .28s; }
.text-desk__form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 12px;
  border-top: 1.5px solid var(--ink);
  background: #fff;
}
.text-desk__form textarea {
  min-height: 46px;
  max-height: 112px;
  resize: none;
  padding: 12px 13px;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  background: var(--cream);
  color: var(--ink);
  font: 500 .9rem/1.35 var(--sans);
}
.text-desk__form textarea:focus { outline: 3px solid rgba(59,137,255,.32); outline-offset: 1px; }
.text-desk__form button,
.text-desk__talk {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font: 600 .88rem/1 var(--sans);
  cursor: pointer;
}
.text-desk__form button { min-width: 74px; padding: 0 17px; background: var(--marigold); color: var(--ink); }
.text-desk__form button:disabled { opacity: .5; cursor: wait; }
.text-desk__foot {
  flex: 0 0 auto;
  padding: 0 12px 8px;
  background: #fff;
  text-align: center;
}
.text-desk__actions { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px 0; border-top: 1.5px solid var(--ink); background: #fff; }
.text-desk__review { display: block; width: fit-content; margin: 12px 0 2px auto; border: 1.5px solid var(--ink); border-radius: 14px; padding: 11px 16px; color: var(--ink); background: var(--marigold); font: 700 14px/1.2 var(--sans); cursor: pointer; }
.text-desk__review[hidden] { display: none; }
.text-desk__review:disabled { opacity: .6; cursor: wait; }
.text-desk__review:focus-visible { outline: 3px solid #2463cf; outline-offset: 2px; }
.text-desk__actions + .text-desk__form { border-top: 0; padding: 10px 12px 7px; }
.text-desk__copy { min-height: 36px; padding: 4px; border: 0; background: transparent; color: var(--ink-soft); font: 500 .72rem/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-desk__talk {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  background: #2463cf;
  color: #fff;
  font-size: .8rem;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.text-desk__talk:not(:disabled):hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.text-desk__talk:not(:disabled):active { transform: translate(1px, 1px); box-shadow: none; }
.text-desk__talk:disabled { opacity: .5; cursor: wait; box-shadow: none; }
.text-desk__talk:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.text-desk__foot p { margin: 0; color: var(--ink-soft); font-size: .64rem; line-height: 1.35; white-space: nowrap; }
.text-desk__foot a { color: inherit; }
.text-desk.is-busy .text-desk__dot { animation: text-pulse 1s ease-in-out infinite; }
@keyframes text-pulse { 50% { opacity: .35; transform: scale(.8); } }
@keyframes text-cursor { 50% { opacity: .15; } }
@keyframes text-thinking {
  0%, 65%, 100% { opacity: .28; transform: translateY(0); }
  32% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 600px) {
  .text-launcher { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .text-desk { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); height: min(720px, calc(100dvh - 24px - env(safe-area-inset-bottom))); max-height: calc(100dvh - 24px - env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .text-launcher, .text-desk, .text-desk__talk { transition: none; }
  .text-desk.is-busy .text-desk__dot { animation: none; }
  .text-message--enter { opacity: 1; transform: none; transition: none; }
  .text-thinking-dot { animation: none; }
  .text-message--streaming > p:last-child::after { animation: none; }
}
