/* made. AI chat widget — grape/water palette, matches the made. site chrome.
   Self-contained; loaded site-wide via the footer partial. */
:root {
  --mc-grape: #592a51;
  --mc-water: #4394ad;
  --mc-snow: #ffffff;
  --mc-ink: #1a1017;
  --mc-line: rgba(89, 42, 81, 0.14);
}

.mc-launcher {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--mc-grape);
  color: var(--mc-snow);
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(89, 42, 81, 0.32);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.mc-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(89, 42, 81, 0.4);
}
.mc-launcher:focus-visible {
  outline: 3px solid var(--mc-water);
  outline-offset: 3px;
}
.mc-launcher svg {
  width: 1.15rem;
  height: 1.15rem;
}
.mc-launcher[hidden] {
  display: none;
}

.mc-panel {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 2147483000;
  width: min(400px, calc(100vw - 2rem));
  height: min(620px, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
  background: var(--mc-snow);
  border: 1px solid var(--mc-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(26, 16, 23, 0.28);
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--mc-ink);
}
.mc-panel[hidden] {
  display: none;
}

.mc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: var(--mc-grape);
  color: var(--mc-snow);
}
.mc-header-title {
  font-family: "League Spartan", "Poppins", system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.1;
}
.mc-header-sub {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 0.1rem;
}
.mc-close {
  border: 0;
  background: transparent;
  color: var(--mc-snow);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 8px;
  line-height: 0;
}
.mc-close:hover {
  background: rgba(255, 255, 255, 0.14);
}
.mc-close:focus-visible {
  outline: 2px solid var(--mc-water);
  outline-offset: 2px;
}
.mc-close svg {
  width: 1.1rem;
  height: 1.1rem;
}

.mc-log {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #faf7f9;
}
.mc-msg {
  max-width: 85%;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.mc-msg-bot {
  align-self: flex-start;
  background: var(--mc-snow);
  border: 1px solid var(--mc-line);
  border-bottom-left-radius: 4px;
}
.mc-msg-user {
  align-self: flex-end;
  background: var(--mc-water);
  color: var(--mc-snow);
  border-bottom-right-radius: 4px;
}
.mc-notice {
  align-self: center;
  text-align: center;
  font-size: 0.78rem;
  color: var(--mc-grape);
  background: rgba(67, 148, 173, 0.12);
  border: 1px solid rgba(67, 148, 173, 0.28);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
}
.mc-typing {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}
.mc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mc-grape);
  opacity: 0.5;
  animation: mc-bounce 1.1s infinite ease-in-out;
}
.mc-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.mc-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes mc-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 0.9; }
}

.mc-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid var(--mc-line);
  background: var(--mc-snow);
}
.mc-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--mc-line);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  max-height: 120px;
  color: var(--mc-ink);
}
.mc-input:focus-visible {
  outline: 2px solid var(--mc-water);
  outline-offset: 0;
  border-color: var(--mc-water);
}
.mc-send {
  border: 0;
  border-radius: 12px;
  background: var(--mc-grape);
  color: var(--mc-snow);
  padding: 0 0.9rem;
  cursor: pointer;
  line-height: 0;
}
.mc-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mc-send:focus-visible {
  outline: 2px solid var(--mc-water);
  outline-offset: 2px;
}
.mc-send svg {
  width: 1.15rem;
  height: 1.15rem;
}

.mc-footnote {
  padding: 0 0.85rem 0.6rem;
  font-size: 0.66rem;
  color: rgba(26, 16, 23, 0.72); /* >=4.5:1 on white for WCAG AA at this size */
  text-align: center;
  background: var(--mc-snow);
}
.mc-footlink {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--mc-water);
  text-decoration: underline;
  cursor: pointer;
}
.mc-footlink:hover {
  color: var(--mc-grape);
}

/* Lead form (lives inside the .mc-leadpanel popout) */
.mc-leadform {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem;
  overflow-y: auto;
}
.mc-leadform-lead {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: rgba(26, 16, 23, 0.7);
}
.mc-leadform-input {
  border: 1px solid var(--mc-line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--mc-ink);
  width: 100%;
}
.mc-leadform-input:focus-visible {
  outline: 2px solid var(--mc-water);
  outline-offset: 0;
  border-color: var(--mc-water);
}
.mc-leadform-textarea {
  resize: vertical;
  min-height: 2.4rem;
  max-height: 8rem;
}
.mc-leadform-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.mc-leadform-send {
  border: 0;
  border-radius: 10px;
  background: var(--mc-grape);
  color: var(--mc-snow);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}
.mc-leadform-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mc-leadform-send:focus-visible {
  outline: 2px solid var(--mc-water);
  outline-offset: 2px;
}
.mc-leadform-dismiss {
  border: 0;
  background: transparent;
  color: rgba(26, 16, 23, 0.55);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}
.mc-leadform-dismiss:hover {
  color: var(--mc-ink);
}
.mc-leadform-status {
  font-size: 0.78rem;
  color: rgba(26, 16, 23, 0.6);
  min-height: 1em;
}
.mc-leadform-status.mc-leadform-err {
  color: #b3261e;
}

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

/* Suggested reply chips */
.mc-suggests {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: 100%;
}
.mc-suggest {
  border: 1px solid var(--mc-water);
  background: rgba(67, 148, 173, 0.08);
  color: var(--mc-grape);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease;
}
.mc-suggest:hover {
  background: rgba(67, 148, 173, 0.18);
}
.mc-suggest:focus-visible {
  outline: 2px solid var(--mc-water);
  outline-offset: 2px;
}

/* Lead popout panel */
.mc-leadpanel {
  position: fixed;
  z-index: 2147483001;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  width: min(400px, calc(100vw - 2rem));
  height: min(620px, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
  background: var(--mc-snow);
  border: 1px solid var(--mc-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(26, 16, 23, 0.28);
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--mc-ink);
}
.mc-leadpanel[hidden] {
  display: none;
}
.mc-leadpanel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  background: var(--mc-grape);
  color: var(--mc-snow);
}
.mc-leadpanel-title {
  font-family: "League Spartan", "Poppins", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
}
.mc-leadpanel-close {
  border: 0;
  background: transparent;
  color: var(--mc-snow);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 8px;
  line-height: 0;
}
.mc-leadpanel-close:hover {
  background: rgba(255, 255, 255, 0.14);
}
.mc-leadpanel-close:focus-visible {
  outline: 2px solid var(--mc-water);
  outline-offset: 2px;
}
.mc-leadpanel-close svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Desktop: form pops out to the right; the chat shifts left to make room. */
.mc-panel {
  transition: transform 0.28s ease;
}
@media (min-width: 720px) and (pointer: fine) {
  .mc-leadpanel {
    width: 330px;
  }
  .mc-panel.mc-shifted {
    transform: translateX(calc(-330px - 0.9rem));
  }
}

/* Mobile: chat + form fill the screen; the form overlays the chat. */
@media (max-width: 520px) {
  .mc-panel,
  .mc-leadpanel {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  /* >=16px stops iOS Safari from auto-zooming (and clipping the fixed panel) on
     input focus. */
  .mc-input,
  .mc-leadform-input {
    font-size: 16px;
  }
}

/* Reduced-motion: this must come AFTER the `.mc-panel { transition: transform }`
   rule above (equal specificity → later source wins) so the lead-form slide is
   actually suppressed for users who asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .mc-panel,
  .mc-panel.mc-shifted {
    transition: none;
  }
}
