/* On-site assistant. Square controls, site palette, readable on light and dark themes. */
.site-assistant {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9000;
  max-width: none;
  font-family: var(--font-primary, 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif);
}

.site-assistant-launch,
.site-assistant-close,
.site-assistant-send,
.site-assistant-chip,
.site-assistant-form input {
  font: inherit;
  border-radius: 0 !important;
}
.site-assistant-launch,
.site-assistant-close,
.site-assistant-send,
.site-assistant-chip {
  cursor: pointer;
}

.site-assistant-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: #6b3a2a;
  color: #fff8f5;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 28px rgba(43, 29, 22, 0.28);
}

.site-assistant-launch:hover {
  background: #3a1d12;
}

.site-assistant-launch[aria-expanded="true"] {
  background: #2b1d16;
}

.site-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  display: none;
  width: min(400px, calc(100vw - 40px));
  max-width: min(400px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 120px));
  flex-direction: column;
  background: #fff8f5;
  color: #2b1d16;
  border: 1px solid rgba(107, 58, 42, 0.28);
  box-shadow: 0 18px 50px rgba(43, 29, 22, 0.28);
}

.site-assistant.is-open .site-assistant-panel {
  display: flex;
}

.site-assistant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  background: #2b1d16;
  color: #fff8f5;
}

.site-assistant-kicker {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffb68e;
}

.site-assistant-head h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.site-assistant-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 1px solid rgba(255, 248, 245, 0.35);
  background: transparent;
  color: #fff8f5;
  font-size: 1.3rem;
  line-height: 1;
}

.site-assistant-log {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-assistant-msg {
  max-width: 92%;
  margin: 0;
  padding: 10px 12px;
  line-height: 1.45;
  font-size: 0.95rem;
}

.site-assistant-msg p {
  margin: 0;
}

.site-assistant-msg p + p {
  margin-top: 8px;
}

.site-assistant-msg a {
  color: inherit;
  font-weight: 700;
}

.site-assistant-msg-bot {
  align-self: flex-start;
  background: #f3eee6;
  color: #2b1d16;
}

.site-assistant-msg-user {
  align-self: flex-end;
  background: #6b3a2a;
  color: #fff8f5;
}

.site-assistant-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.site-assistant-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.site-assistant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}

.site-assistant-chip {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(107, 58, 42, 0.4);
  background: transparent;
  color: #6b3a2a;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
}

.site-assistant-chip:hover {
  background: #ffdcc6;
}

.site-assistant-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(107, 58, 42, 0.18);
}

.site-assistant-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.site-assistant-form input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(107, 58, 42, 0.45);
  border-radius: 0;
  background: #fff;
  color: #2b1d16;
  font: inherit;
  font-size: 1rem;
}

.site-assistant-send {
  min-width: 76px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: #6b3a2a;
  color: #fff8f5;
  font-weight: 700;
}

.site-assistant-send:hover {
  background: #3a1d12;
}

.site-assistant-send:disabled {
  opacity: 0.55;
}

[data-theme="dark"] .site-assistant-panel {
  background: #1c1916;
  color: #fff8f5;
  border-color: rgba(255, 220, 198, 0.28);
}

[data-theme="dark"] .site-assistant-msg-bot {
  background: #2c2620;
  color: #fff8f5;
}

[data-theme="dark"] .site-assistant-chip {
  color: #ffdcc6;
  border-color: rgba(255, 220, 198, 0.45);
}

[data-theme="dark"] .site-assistant-chip:hover {
  background: #3a1d12;
  color: #fff8f5;
}

[data-theme="dark"] .site-assistant-form {
  border-top-color: rgba(255, 248, 245, 0.16);
}

[data-theme="dark"] .site-assistant-form input {
  background: #2c2620;
  color: #fff8f5;
  border-color: rgba(255, 220, 198, 0.4);
}

@media (max-width: 640px) {
  .site-assistant {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
  .site-assistant-panel {
    right: 0;
    left: 0;
    width: auto;
    height: min(70vh, 560px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-assistant-panel {
    scroll-behavior: auto;
  }
}
