/* Appily Ninetyeight contact — Bubble Chat Cascade
   Mango · aqua · lemon · Bagel Soft + Mulish */

:root {
  --bc-ink: #14202E;
  --bc-mango: #C43A12;
  --bc-mango-deep: #A02E0A;
  --bc-aqua: #00E8C4;
  --bc-aqua-deep: #0A7A6A;
  --bc-lemon: #FFD84D;
  --bc-field: #EEFBFF;
  --bc-field-deep: #D9F4FA;
  --bc-surface: #FFFFFF;
  --bc-mute: #3D4F5C;
  --bc-ok: #0A7A58;
  --bc-err: #B42318;
  --bc-thread: #1A2A3A;
  --bc-display: "Bagel Soft", "Segoe UI", sans-serif;
  --bc-body: "Mulish", "Segoe UI", sans-serif;
  --bc-radius: 22px;
  --bc-shadow: 0 16px 40px rgba(20, 32, 46, 0.14);
  --bc-ease: cubic-bezier(0.34, 1.45, 0.64, 1);
  --bc-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --bc-space: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.a98-chat {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--bc-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--bc-ink);
  background:
    radial-gradient(620px 340px at 95% -5%, rgba(255, 90, 31, 0.18), transparent 55%),
    radial-gradient(540px 300px at 0% 45%, rgba(0, 232, 196, 0.16), transparent 50%),
    radial-gradient(420px 240px at 50% 100%, rgba(255, 216, 77, 0.22), transparent 45%),
    linear-gradient(180deg, var(--bc-field) 0%, #F5FCFF 40%, var(--bc-field-deep) 100%);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bc-mango-deep); text-decoration: none; }
a:hover { color: var(--bc-aqua-deep); }

.skip-link {
  position: absolute; left: 16px; top: -120px; z-index: 1000;
  padding: 10px 14px; border-radius: 999px;
  background: var(--bc-mango); color: #fff; font-weight: 800;
}
.skip-link:focus,
.skip-link:focus-visible { top: 12px; color: #fff; outline: 3px solid var(--bc-aqua); outline-offset: 2px; }

/* Hop */
.bc-hop {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem var(--bc-space);
  background: rgba(238, 251, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--bc-ink);
}
.bc-hop-brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--bc-ink) !important; text-decoration: none !important;
}
.bc-hop-brand:hover,
.bc-hop-brand:focus-visible {
  color: var(--bc-ink) !important;
  outline: none;
}
.bc-hop-brand:focus-visible {
  outline: 3px solid var(--bc-aqua);
  outline-offset: 4px;
  border-radius: 12px;
}
.bc-hop-brand small {
  display: block; font-size: 0.62rem; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 800; color: var(--bc-mute);
}
.bc-hop-brand strong {
  font-family: var(--bc-display); font-size: 1.25rem; font-weight: 500;
}
.bc-bubble-mark {
  width: 36px; height: 32px;
  display: grid; place-items: center;
}
.bc-bubble-mark i {
  width: 26px; height: 22px;
  border-radius: 14px 14px 14px 4px;
  background: var(--bc-mango);
  border: 2px solid var(--bc-ink);
  box-shadow: 2px 2px 0 var(--bc-aqua);
}

.bc-hop-links { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-left: auto; }
.bc-hop-links a {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.75rem; border-radius: 999px;
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--bc-mute) !important;
  border: 2px solid transparent;
}
.bc-hop-links a:hover,
.bc-hop-links a:focus-visible,
.bc-hop-links a[aria-current="page"] {
  color: var(--bc-ink) !important;
  background: var(--bc-lemon);
  border-color: var(--bc-ink);
  outline: none;
}
.bc-hop-links a:focus-visible {
  outline: 3px solid var(--bc-aqua);
  outline-offset: 2px;
}
.bc-hop-links em, .bc-hop-sheet em {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.15rem; height: 1.15rem; padding: 0 0.25rem;
  border-radius: 999px; background: var(--bc-mango); color: #fff;
  font-style: normal; font-size: 0.65rem;
}
.bc-hop-menu {
  display: none; flex-direction: column; justify-content: center; gap: 4px; margin-left: auto;
  padding: 0.5rem; min-width: 42px; min-height: 42px;
  border: 2px solid var(--bc-ink); border-radius: 10px;
  background: var(--bc-lemon); cursor: pointer;
  transition: background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.bc-hop-menu span { display: block; width: 16px; height: 2px; background: var(--bc-ink); }
.bc-hop-menu:hover,
.bc-hop-menu:focus-visible {
  background: var(--bc-aqua);
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--bc-ink);
  outline: none;
}
.bc-hop-menu:focus-visible {
  outline: 3px solid var(--bc-mango);
  outline-offset: 2px;
}
.bc-hop-sheet {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  flex-direction: column; padding: 0.5rem var(--bc-space) 1rem;
  background: var(--bc-surface); border-bottom: 2px solid var(--bc-ink);
}
.bc-hop.is-open .bc-hop-sheet { display: flex !important; }
.bc-hop-sheet a {
  padding: 0.8rem 0.25rem; border-bottom: 1px solid rgba(20,32,46,0.12);
  color: var(--bc-ink); font-weight: 800; text-transform: uppercase; font-size: 0.85rem;
  text-decoration: none !important;
  transition: color 180ms ease, padding-left 180ms ease;
}
.bc-hop-sheet a:hover,
.bc-hop-sheet a:focus-visible,
.bc-hop-sheet a[aria-current="page"] {
  color: var(--bc-mango-deep) !important;
  padding-left: 0.35rem;
  outline: none;
}
.bc-hop-sheet a:focus-visible {
  outline: 3px solid var(--bc-aqua);
  outline-offset: -2px;
}
@media (max-width: 900px) {
  .bc-hop-links { display: none; }
  .bc-hop-menu { display: inline-flex; }
}

/* Mast */
.bc-mast {
  max-width: 720px; margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) var(--bc-space) 0.75rem;
  text-align: center;
}
.bc-kicker {
  margin: 0 0 0.35rem; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--bc-mango);
}
.bc-mast h1 {
  margin: 0 0 0.45rem; font-family: var(--bc-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 500; line-height: 1.1;
}
.bc-mast p {
  margin: 0 auto; max-width: 34rem; color: var(--bc-mute);
}

.bc-stage {
  max-width: 720px; margin: 0 auto;
  padding: 0.5rem var(--bc-space) 2.5rem;
  flex: 1;
}

/* Thread shell */
.bc-thread {
  border: 3px solid var(--bc-ink);
  border-radius: 28px;
  background: var(--bc-thread);
  box-shadow: var(--bc-shadow);
  overflow: hidden;
  padding: 1rem 1rem 1.25rem;
}

.bc-notice {
  margin: 0 0 0.85rem; padding: 0.9rem 1rem;
  border-radius: 18px 18px 18px 6px;
  border: 2px solid var(--bc-ink);
  font-weight: 700;
}
.bc-notice strong {
  display: block; margin-bottom: 0.2rem;
  font-family: var(--bc-display); font-size: 1.2rem; font-weight: 500;
}
.bc-notice p { margin: 0; font-weight: 600; }
.bc-notice.is-success {
  background: #D8F5EA;
  color: #0A5C45;
  box-shadow: 3px 3px 0 var(--bc-ok);
}
.bc-notice.is-error {
  background: #FDE8E8;
  color: #8B1219;
  box-shadow: 3px 3px 0 var(--bc-err);
  animation: bcShake 360ms var(--bc-ease);
}
@keyframes bcShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* Outgoing chat bubbles (form) */
.bc-bubbles {
  display: flex; flex-direction: column; gap: 0.7rem;
  margin-bottom: 0.85rem;
}
.bc-bubble {
  position: relative;
  align-self: flex-end;
  width: min(100%, 520px);
  padding: 0.85rem 1rem 1rem;
  border: 3px solid var(--bc-ink);
  border-radius: 22px 22px 6px 22px;
  background: var(--bc-surface);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  transition: transform 260ms var(--bc-ease-out), box-shadow 260ms ease, background 260ms ease;
}
.bc-bubble:nth-child(even) {
  align-self: flex-start;
  border-radius: 22px 22px 22px 6px;
  transform: rotate(-0.4deg);
}
.bc-bubble:nth-child(odd) { transform: rotate(0.5deg); }
.bc-bubble.is-focused {
  transform: rotate(0) translateY(-3px) scale(1.01);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.28), 4px 4px 0 var(--bc-aqua);
  z-index: 2;
}
.bc-bubble.is-filled {
  background: linear-gradient(160deg, #fff 0%, rgba(0, 232, 196, 0.12) 100%);
  box-shadow: 3px 3px 0 var(--bc-aqua);
}
.bc-bubble.is-invalid {
  box-shadow: 0 0 0 3px rgba(255, 59, 74, 0.35), 3px 3px 0 var(--bc-err);
  animation: bcShake 360ms var(--bc-ease);
}

.bc-bubble label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--bc-mute);
}
.bc-bubble label > span {
  transition: color 240ms ease, transform 240ms var(--bc-ease-out);
}
.bc-bubble.is-focused label > span {
  color: var(--bc-mango);
  transform: translateY(-1px);
}
.bc-bubble input,
.bc-bubble textarea {
  border: 0; outline: none; background: transparent;
  font-family: var(--bc-body);
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: normal; text-transform: none;
  color: var(--bc-ink); width: 100%;
  padding: 0.2rem 0 0.35rem;
  resize: vertical;
}
.bc-bubble input::placeholder,
.bc-bubble textarea::placeholder {
  color: var(--bc-mute);
  opacity: 1;
}
.bc-bubble-rule {
  display: block; height: 3px; width: 100%;
  border-radius: 999px;
  background: rgba(20, 32, 46, 0.12);
  transform: scaleX(0.28);
  transform-origin: left center;
  transition: transform 280ms var(--bc-ease-out), background 280ms ease;
}
.bc-bubble.is-focused .bc-bubble-rule {
  transform: scaleX(1);
  background: var(--bc-mango);
}
.bc-bubble.is-filled .bc-bubble-rule {
  transform: scaleX(1);
  background: var(--bc-aqua);
}

.bc-send-wrap {
  display: flex; justify-content: flex-end;
  margin-bottom: 0.5rem;
}
.bc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.7rem 1.35rem;
  border: 2px solid var(--bc-ink); border-radius: 999px;
  font-family: var(--bc-body); font-weight: 800;
  font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; text-decoration: none !important;
  position: relative; overflow: hidden;
  transition: transform 220ms var(--bc-ease-out), box-shadow 220ms ease;
}
.bc-btn--mango {
  background: var(--bc-mango); color: #fff !important;
  box-shadow: 4px 4px 0 var(--bc-lemon);
}
.bc-btn--mango::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--bc-aqua);
  transform: translateX(-105%);
  transition: transform 280ms var(--bc-ease-out);
}
.bc-btn--mango:hover,
.bc-btn--mango:focus-visible {
  color: var(--bc-ink) !important;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--bc-lemon);
}
.bc-btn--mango:hover::before,
.bc-btn--mango:focus-visible::before { transform: translateX(0); }
.bc-btn--mango > * { position: relative; z-index: 1; }
.bc-btn:focus-visible {
  outline: 3px solid var(--bc-lemon);
  outline-offset: 3px;
}
.bc-btn--mango:focus-visible { outline-color: var(--bc-aqua); }
.bc-btn--mango.is-sending {
  transform: scale(0.97);
  box-shadow: 2px 2px 0 var(--bc-lemon);
}

/* Desk reply thread (addresses) */
.bc-replies {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px dashed rgba(255,255,255,0.15);
}
.bc-replies-head {
  margin: 0 0 0.75rem;
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bc-aqua);
}
.bc-reply-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.bc-reply {
  align-self: flex-start;
  max-width: 92%;
  padding: 0.75rem 0.95rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 6px 22px 22px 22px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  animation: bcSlideIn 480ms var(--bc-ease-out) both;
  animation-delay: calc(var(--bc-i, 0) * 70ms);
}
.bc-reply:nth-child(even) {
  background: rgba(0, 232, 196, 0.12);
  border-color: rgba(0, 232, 196, 0.35);
}
.bc-reply:nth-child(3n) {
  background: rgba(255, 216, 77, 0.12);
  border-color: rgba(255, 216, 77, 0.35);
}
@keyframes bcSlideIn {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}
.bc-reply dt {
  margin: 0 0 0.2rem;
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--bc-lemon);
}
.bc-reply dd { margin: 0; font-weight: 600; word-break: break-word; }
.bc-reply a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.bc-reply a:hover { color: var(--bc-aqua); }

/* Quick-reply channel chips */
.bc-channels {
  margin-top: 1.15rem;
}
.bc-channels-head {
  margin: 0 0 0.65rem;
  font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bc-mute);
  text-align: center;
}
.bc-channel-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
}
.bc-channel a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: 2px solid var(--bc-ink);
  border-radius: 999px;
  background: var(--bc-surface);
  color: var(--bc-ink) !important;
  font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--bc-aqua);
  transition: transform 240ms var(--bc-ease), background 240ms ease, box-shadow 240ms ease;
}
.bc-channel a:hover,
.bc-channel a:focus-visible {
  background: var(--bc-lemon);
  color: var(--bc-ink) !important;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 3px 5px 0 var(--bc-mango);
  outline: none;
}
.bc-channel a:focus-visible {
  outline: 3px solid var(--bc-aqua);
  outline-offset: 2px;
}
.bc-channel-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bc-mango);
  border: 2px solid var(--bc-ink);
  transition: transform 240ms var(--bc-ease), background 240ms ease;
}
.bc-channel a:hover .bc-channel-dot,
.bc-channel a:focus-visible .bc-channel-dot {
  background: var(--bc-aqua);
  transform: scale(1.35) rotate(20deg);
}
.bc-channel:nth-child(2) .bc-channel-dot { background: var(--bc-aqua); }
.bc-channel:nth-child(3) .bc-channel-dot { background: var(--bc-lemon); }
.bc-channel:nth-child(4) .bc-channel-dot { background: var(--bc-ok); }
.bc-channel:nth-child(5) .bc-channel-dot { background: var(--bc-mango-deep); }

/* Moisture Channel footer */
body.a98-chat .mch-foot { margin-top: clamp(40px, 6vw, 72px); }
body.a98-chat .mch-foot a { text-decoration: none; }

@media (max-width: 640px) {
  .bc-send-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .bc-send-wrap .bc-btn {
    width: 100%;
  }
  .bc-channel-list {
    flex-direction: column;
    align-items: stretch;
  }
  .bc-channel {
    width: 100%;
  }
  .bc-channel a {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bc-bubble, .bc-reply, .bc-channel a, .bc-btn, .bc-notice.is-error {
    transition: none !important; animation: none !important;
  }
}
