/* Chat widget. Uses the theme tokens, so it follows Appearance > Customize > Design. */

#s7bot, #s7bot * { box-sizing: border-box; }
#s7bot[hidden] { display: none; }
#s7bot {
  position: fixed; right: 22px; bottom: 22px; z-index: 9000;
  font-family: var(--sans);
}

#s7bot-launch {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border: 0;
  background: var(--ink); color: #fff;
  font-family: var(--display); font-size: 18px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; cursor: pointer;
  box-shadow: 0 14px 40px rgba(8, 9, 11, .3);
  transition: background .18s;
}
#s7bot-launch:hover { background: var(--red); }
#s7bot-launch svg { display: block; width: 21px; height: 21px; flex-shrink: 0; color: var(--red); }
#s7bot-launch:hover svg { color: #fff; }

/* The dismiss affordance sits on the launcher, not inside the panel: a visitor
   who does not want this needs to remove it without opening it first. */
#s7bot-dismiss {
  position: absolute; top: -9px; right: -9px;
  width: 24px; height: 24px; padding: 0;
  border: 2px solid var(--paper); border-radius: 50%;
  background: #5b626b; color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
}
#s7bot-dismiss:hover { background: var(--ink); }
#s7bot.open #s7bot-dismiss, #s7bot.open #s7bot-launch { display: none; }

#s7bot-panel {
  display: none; flex-direction: column;
  width: min(92vw, 410px); height: min(88vh, 720px);
  background: var(--white);
  border-top: 3px solid var(--red);
  box-shadow: 0 30px 80px rgba(8, 9, 11, .32);
}
#s7bot.open #s7bot-panel { display: flex; }

#s7bot-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 17px; background: var(--ink); color: #fff;
}
#s7bot-head p {
  margin: 0; font-family: var(--display); font-size: 20px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; line-height: 1.1;
}
#s7bot-head span {
  display: block; color: rgba(255, 255, 255, .55);
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
#s7bot-close { border: 0; background: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 2px; }

#s7bot-log { flex: 1; overflow-y: auto; padding: 17px; background: var(--paper); }
.s7bot-m { margin-bottom: 13px; font-size: 15px; line-height: 1.6; }
.s7bot-m.u { text-align: right; }
.s7bot-m.u span {
  display: inline-block; max-width: 85%; padding: 9px 13px;
  background: var(--ink); color: #fff; text-align: left;
}
.s7bot-m.a span {
  display: block; padding: 12px 14px; background: var(--white);
  border-left: 3px solid var(--red); color: var(--ink);
}
.s7bot-m.a span p { margin: 0 0 .6em; }
.s7bot-m.a span p:last-child { margin: 0; }
.s7bot-m.a span ul, .s7bot-m.a span ol { margin: .4em 0; padding-left: 1.15em; }
.s7bot-m.a span li { margin-bottom: .25em; }
.s7bot-m.a span a { color: var(--red); font-weight: 700; text-decoration: underline; }
.s7bot-m.e span { background: var(--white); border-left: 3px solid var(--red-dark); color: var(--red-dark); }

.s7bot-dots span {
  display: inline-block; width: 5px; height: 5px; margin-right: 3px;
  background: var(--muted); border-radius: 50%; animation: s7bot-blink 1.1s infinite;
}
.s7bot-dots span:nth-child(2) { animation-delay: .16s; }
.s7bot-dots span:nth-child(3) { animation-delay: .32s; }
@keyframes s7bot-blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

#s7bot-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 17px 12px; background: var(--paper); }
#s7bot-suggest button {
  padding: 7px 11px; border: 1px solid var(--line); background: var(--white);
  color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; cursor: pointer;
}
#s7bot-suggest button:hover { border-color: var(--red); color: var(--ink); }

/* interaction-only means this is empty unless a challenge is actually required,
   so it must not reserve any height of its own. */
#s7bot-turnstile:empty { display: none; }
#s7bot-turnstile:not(:empty) { padding: 10px 17px 0; background: var(--white); }

#s7bot-form {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px; border-top: 1px solid var(--line); background: var(--white);
}
#s7bot-input {
  flex: 1; min-height: 116px; max-height: 220px; padding: 11px 12px;
  border: 1px solid var(--line); outline: none; resize: none;
  font-size: 15px; line-height: 1.5;
}
#s7bot-input:focus { border-color: var(--ink); }
#s7bot-input:disabled { background: var(--paper); }
#s7bot-send {
  align-self: flex-end; flex: 0 0 auto; padding: 12px 20px; border: 0;
  background: var(--red); color: #fff;
  font-family: var(--display); font-size: 17px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; cursor: pointer;
}
#s7bot-send:hover:not(:disabled) { background: var(--red-dark); }
#s7bot-send:disabled { background: #b9bec5; cursor: default; }

#s7bot-foot {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 17px 11px; background: var(--white);
  color: var(--muted); font-size: 11px; letter-spacing: .03em;
}
#s7bot-foot a { color: var(--red); font-weight: 700; }

@media (max-width: 600px) {
  #s7bot { right: 14px; bottom: 14px; left: 14px; }
  #s7bot-launch { width: 100%; justify-content: center; }
  #s7bot-panel { width: 100%; height: min(86vh, 640px); }
}
