body > .contact-widget {
  position: fixed;
  z-index: 65;
  right: clamp(18px, 2.6vw, 42px);
  bottom: clamp(18px, 2.6vw, 38px);
  width: max-content;
  max-width: calc(100vw - 24px);
  font-family: var(--sans);
  isolation: isolate;
}

.contact-trigger {
  min-height: 56px;
  padding: 0 22px 0 17px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(45, 36, 31, .2);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 12px 38px rgba(45, 36, 31, .18);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  transition: transform .2s ease, background-color .2s ease;
}

.contact-trigger:hover { background: #493d36; transform: translateY(-2px); }
.contact-trigger:focus-visible, .contact-panel button:focus-visible, .contact-composer textarea:focus-visible { outline: 2px solid var(--taupe); outline-offset: 3px; }

.contact-trigger__icon {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  font: 400 15px/1 var(--serif);
}

.contact-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100svh - 120px));
  min-height: 470px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  border: 1px solid rgba(45, 36, 31, .15);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(45, 36, 31, .2);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transform-origin: bottom right;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.contact-widget.is-open .contact-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.contact-widget.is-open .contact-trigger { background: var(--white); color: var(--ink); }

.contact-panel__head {
  padding: 24px 22px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.contact-panel__head p { margin: 0 0 7px; color: var(--taupe); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.contact-panel__head h2 { margin: 0 0 10px; font: 400 34px/.95 var(--serif); letter-spacing: -.04em; }
.contact-panel__head span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.contact-panel__head span i { width: 6px; height: 6px; border-radius: 50%; background: #74816c; box-shadow: 0 0 0 4px rgba(116,129,108,.12); }
.contact-panel__close { width: 34px; height: 34px; flex: 0 0 auto; cursor: pointer; font: 300 25px/1 Arial, sans-serif; }

.contact-panel__body { padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.contact-message { width: fit-content; max-width: 88%; margin-bottom: 10px; padding: 12px 14px; border-radius: 16px 16px 16px 4px; font-size: 13px; line-height: 1.45; }
.contact-message--brand { background: var(--paper-2); }
.contact-message--user { margin-left: auto; border-radius: 16px 16px 4px 16px; background: var(--ink); color: var(--white); }

.contact-topics { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 7px; }
.contact-topics button { padding: 9px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; color: var(--ink); font-size: 10px; transition: background-color .18s ease, border-color .18s ease; }
.contact-topics button:hover { background: var(--paper); border-color: rgba(45,36,31,.3); }

.contact-composer { margin: 0 14px; min-height: 58px; display: grid; grid-template-columns: 1fr 42px; align-items: end; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.contact-composer textarea { min-width: 0; max-height: 100px; padding: 15px 4px 14px 15px; resize: none; overflow-y: auto; border: 0; outline: 0; background: transparent; color: var(--ink); font: 13px/1.4 var(--sans); }
.contact-composer textarea::placeholder { color: #9b918a; }
.contact-composer button { width: 34px; height: 34px; margin: 0 7px 11px 0; border-radius: 50%; background: var(--ink); color: var(--white); cursor: pointer; font-size: 18px; }
.contact-panel__note { margin: 9px 18px 12px; color: var(--muted); text-align: center; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }

@media (max-width: 760px) {
  body > .contact-widget { right: 12px; bottom: 12px; }
  .contact-trigger { min-height: 52px; padding: 0 18px 0 14px; }
  .contact-panel { bottom: 62px; width: calc(100vw - 24px); height: min(610px, calc(100svh - 88px)); min-height: 420px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-panel, .contact-trigger { transition: none; }
}
