/* Village Concierge: palette from the community's own email templates (sage cards with a left rule). */
.vwlc-launcher,
.vwlc-panel {
  --vwlc-pine: #2f4f45;
  --vwlc-sage: #5a7a6a;
  --vwlc-mist: #eef3f0;
  --vwlc-ink: #1f2a26;
  --vwlc-line: #d3ddd8;
  --vwlc-focus: #e0a526;
  --vwlc-fs: 18px;
  --vwlc-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --vwlc-serif: Georgia, "Times New Roman", serif;
  box-sizing: border-box;
  z-index: 2147483000; /* above theme widgets such as back-to-top arrows */
  font-family: var(--vwlc-sans);
  color: var(--vwlc-ink);
}

.vwlc-panel *,
.vwlc-launcher * { box-sizing: border-box; }

.vwlc-panel.vwlc-large { --vwlc-fs: 21px; }

.vwlc-panel button,
.vwlc-launcher {
  font-family: var(--vwlc-sans);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.2;
  cursor: pointer;
}

.vwlc-panel :focus-visible,
.vwlc-launcher:focus-visible {
  outline: 3px solid var(--vwlc-focus);
  outline-offset: 2px;
}

/* Launcher: words, not just an icon, because many visitors won't guess what a bubble does. */
.vwlc-launcher {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 14px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--vwlc-pine);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(31, 42, 38, 0.28);
}

.vwlc-launcher:hover { background: #26423a; }
.vwlc-launcher[hidden] { display: none; }

/* A small ripple on the lake: the one moment of motion, played once. */
.vwlc-ripple {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
}

.vwlc-ripple::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.vwlc-ripple::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  animation: vwlc-ripple 2.4s ease-out 1.2s 2 both;
}

@keyframes vwlc-ripple {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(2.1); opacity: 0; }
}

/* Panel */
.vwlc-panel {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(420px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(31, 42, 38, 0.3);
  font-size: var(--vwlc-fs);
}

.vwlc-panel[hidden] { display: none; }

.vwlc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px 20px;
  background: var(--vwlc-pine);
  color: #fff;
}

.vwlc-title { display: flex; flex-direction: column; gap: 8px; }
.vwlc-title strong { font-size: 1em; font-weight: 600; }

.vwlc-call {
  align-self: flex-start;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--vwlc-pine) !important;
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none !important;
}

.vwlc-tools { display: flex; gap: 6px; }

.vwlc-tool {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 20px;
}

.vwlc-tool[aria-pressed="true"] { background: rgba(255, 255, 255, 0.18); }

/* Conversation */
.vwlc-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}

.vwlc-msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.vwlc-bot {
  align-self: flex-start;
  background: var(--vwlc-mist);
  font-family: var(--vwlc-serif);
  border-bottom-left-radius: 4px;
}

.vwlc-bot a { color: var(--vwlc-pine); text-decoration: underline; }

.vwlc-user {
  align-self: flex-end;
  background: var(--vwlc-pine);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.vwlc-typing { display: inline-flex; gap: 6px; padding: 16px; }

.vwlc-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vwlc-sage);
  animation: vwlc-dot 1.2s infinite ease-in-out;
}

.vwlc-typing span:nth-child(2) { animation-delay: 0.15s; }
.vwlc-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes vwlc-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Quick replies */
.vwlc-choices { display: flex; flex-wrap: wrap; gap: 8px; }

.vwlc-choice {
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--vwlc-sage);
  border-radius: 999px;
  background: #fff;
  color: var(--vwlc-pine) !important;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
}

.vwlc-choice:hover { background: var(--vwlc-mist); }
.vwlc-choices.vwlc-used { display: none; }

/* Summary card echoes the left-rule cards in the community's emails. */
.vwlc-card {
  border: 1px solid var(--vwlc-line);
  border-left: 4px solid var(--vwlc-sage);
  border-radius: 10px;
  padding: 16px 16px 12px;
  background: #fff;
}

.vwlc-card-head { margin: 0 0 10px; font-weight: 700; }
.vwlc-card dl { margin: 0; }
.vwlc-row { padding: 8px 0; border-top: 1px solid var(--vwlc-line); }
.vwlc-row:first-child { border-top: 0; padding-top: 0; }
.vwlc-row dt { font-size: 0.8em; color: #4d5c56; margin: 0 0 2px; }
.vwlc-row dd { margin: 0; overflow-wrap: anywhere; }

.vwlc-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.vwlc-primary,
.vwlc-secondary {
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.95em;
  font-weight: 600;
}

.vwlc-primary { border: 0; background: var(--vwlc-pine); color: #fff; }
.vwlc-secondary { border: 2px solid var(--vwlc-sage); background: #fff; color: var(--vwlc-pine); }
.vwlc-primary:disabled,
.vwlc-secondary:disabled { opacity: 0.5; cursor: default; }

.vwlc-card-status { margin: 10px 0 0; font-size: 0.85em; color: var(--vwlc-pine); font-weight: 600; }
.vwlc-card-status:empty { display: none; }

/* Composer */
.vwlc-compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px;
  border-top: 1px solid var(--vwlc-line);
}

.vwlc-input {
  flex: 1;
  min-height: 48px;
  max-height: 140px;
  resize: none;
  padding: 12px 14px;
  border: 1px solid #9fb0a8;
  border-radius: 10px;
  font: inherit;
  font-size: var(--vwlc-fs);
  color: var(--vwlc-ink);
  background: #fff;
}

.vwlc-send {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--vwlc-pine);
  color: #fff;
  font-size: 0.95em;
  font-weight: 600;
}

.vwlc-send:disabled { opacity: 0.5; }

.vwlc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  font-size: 0.75em;
  color: #4d5c56;
}

.vwlc-link {
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--vwlc-pine);
  text-decoration: underline;
  font-size: 1em;
}

/* Phones: full screen, so text stays large and nothing is cramped. */
@media (max-width: 560px) {
  .vwlc-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .vwlc-launcher {
    right: auto;
    left: 12px;
    bottom: calc(var(--vwlc-lift, 12px) + env(safe-area-inset-bottom, 0px));
    padding: 12px 18px 12px 14px;
    font-size: 17px;
  }

  .vwlc-launcher.vwlc-phone-right { left: auto; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .vwlc-ripple::before,
  .vwlc-typing span { animation: none; }
}
