/* ParkedRV — Parky the park ranger chat bubble (assets/parky.js).
   Uses the site colors from master.css; dark mode follows data-bs-theme="dark". */

.parky-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem 0.45rem 0.45rem;
  border: 2px solid #fdf6ec;
  border-radius: 999px;
  background: var(--color-forest, #1f4733);
  color: #fdf6ec;
  font: 600 1rem/1 'Inter', system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.parky-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); }
.parky-launcher:focus-visible { outline: 3px solid var(--color-gold, #d99a3d); outline-offset: 3px; }
.parky-launcher-hat {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #fdf6ec;
  align-items: center;
  justify-content: center;
}
.parky-launcher-hat svg { width: 2.1rem; height: 2.1rem; }
.parky-launcher.is-open { display: none; }

.parky-panel {
  --parky-bg: #fdf8ec;
  --parky-surface: #ffffff;
  --parky-text: #2b2b2b;
  --parky-muted: #6b6457;
  --parky-border: rgba(31, 71, 51, 0.15);
  --parky-user: var(--color-primary, #2f6b4f);
  --parky-tag-bg: rgba(47, 107, 79, 0.1);
  --parky-tag-text: #2f6b4f;

  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 560px;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--parky-bg);
  color: var(--parky-text);
  font: 400 0.95rem/1.45 'Inter', system-ui, sans-serif;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}
.parky-panel[hidden] { display: none; }

[data-bs-theme="dark"] .parky-panel {
  --parky-bg: #121a17;
  --parky-surface: #1b2621;
  --parky-text: #e6e0d2;
  --parky-muted: #a59f90;
  --parky-border: rgba(230, 224, 210, 0.14);
  --parky-user: #2f6b4f;
  --parky-tag-bg: rgba(143, 196, 166, 0.14);
  --parky-tag-text: #8fc4a6;
}

.parky-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem 0.7rem 0.9rem;
  background: var(--color-forest, #1f4733);
  color: #fdf6ec;
}
.parky-avatar {
  flex: none;
  display: inline-flex;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #fdf6ec;
  align-items: center;
  justify-content: center;
}
.parky-avatar svg { width: 2rem; height: 2rem; }
.parky-titles { flex: 1; min-width: 0; }
.parky-title { font: 700 1.1rem/1.1 'Fraunces', Georgia, serif; }
.parky-subtitle { font-size: 0.78rem; opacity: 0.8; }
.parky-icon-btn {
  flex: none;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fdf6ec;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.parky-icon-btn:hover { background: rgba(253, 246, 236, 0.15); }
.parky-icon-btn:focus-visible { outline: 2px solid var(--color-gold, #d99a3d); }

.parky-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overscroll-behavior: contain;
}

.parky-msg { max-width: 88%; overflow-wrap: anywhere; }
.parky-user {
  align-self: flex-end;
  padding: 0.5rem 0.8rem;
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: var(--parky-user);
  color: #fdf6ec;
}
.parky-bot { align-self: flex-start; width: 100%; max-width: 100%; }
.parky-reply {
  display: inline-block;
  max-width: 92%;
  padding: 0.55rem 0.8rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: var(--parky-surface);
  border: 1px solid var(--parky-border);
  white-space: pre-line;
}

.parky-group {
  margin-top: 0.5rem;
  border: 1px solid var(--parky-border);
  border-radius: 0.75rem;
  background: var(--parky-surface);
  overflow: hidden;
}
.parky-group-title {
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--parky-muted);
  border-bottom: 1px solid var(--parky-border);
}
.parky-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.75rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--parky-border);
}
.parky-item:hover, .parky-item:focus-visible { background: var(--parky-tag-bg); }
.parky-item-name { font-weight: 600; color: var(--parky-tag-text); }
.parky-item-meta { font-size: 0.82rem; color: var(--parky-muted); }
.parky-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.parky-tag {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--parky-tag-bg);
  color: var(--parky-tag-text);
}
.parky-more {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent, #e8613c);
  text-decoration: none;
}
.parky-more:hover { text-decoration: underline; }
.parky-bot > .parky-more { padding-left: 0.2rem; }

.parky-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.parky-chip {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--parky-tag-text);
  border-radius: 999px;
  background: transparent;
  color: var(--parky-tag-text);
  font: 500 0.82rem/1.2 'Inter', system-ui, sans-serif;
  cursor: pointer;
}
.parky-chip:hover { background: var(--parky-tag-bg); }

.parky-typing { display: inline-flex; gap: 0.3rem; width: auto; padding: 0.7rem 0.9rem; border-radius: 1rem; background: var(--parky-surface); border: 1px solid var(--parky-border); }
.parky-typing span { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--parky-muted); animation: parky-dot 1.2s infinite ease-in-out; }
.parky-typing span:nth-child(2) { animation-delay: 0.15s; }
.parky-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes parky-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.parky-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem;
  border-top: 1px solid var(--parky-border);
  background: var(--parky-surface);
}
.parky-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--parky-border);
  border-radius: 999px;
  background: var(--parky-bg);
  color: var(--parky-text);
  font-size: 1rem; /* 16px stops iOS zooming in on focus */
}
.parky-input:focus { outline: 2px solid var(--color-primary, #2f6b4f); outline-offset: 0; }
.parky-send {
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--color-accent, #e8613c);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.parky-send:disabled { opacity: 0.6; cursor: wait; }

@media (max-width: 575.98px) {
  .parky-launcher { right: 1rem; bottom: 1rem; }
  .parky-launcher-label { display: none; }
  .parky-launcher { padding: 0.35rem; }
  .parky-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .parky-launcher, .parky-typing span { transition: none; animation: none; }
}
