/* RX Mechanical contact dock and reviewed-request contact panel. */
.rx-contact-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(380px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid rgba(9, 43, 98, 0.18);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(6, 29, 69, 0.24);
  font-family: Arial, sans-serif;
}

.rx-dock-action {
  display: inline-flex;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid rgba(9, 43, 98, 0.12);
  background: #ffffff;
  color: #092b62;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.rx-dock-action:last-child {
  border-right: 0;
}

.rx-contact-dock svg,
.rx-panel svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rx-close svg {
  width: 20px;
  height: 20px;
}

.rx-dock-action[data-rx-open="book"] {
  background: #ffffff;
  color: #000000;
}

.rx-dock-action svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.rx-dock-action span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rx-dock-action:hover {
  background: #087cff;
  color: #ffffff;
}

.rx-panel {
  position: fixed;
  top: auto;
  right: 24px;
  bottom: 96px;
  left: auto;
  box-sizing: border-box;
  width: min(420px, calc(100vw - 48px));
  max-height: min(82dvh, 780px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #087cff;
  border-radius: 16px;
  background: #ffffff;
  color: #061d45;
  box-shadow: 0 22px 64px rgba(6, 29, 69, 0.36);
  font-family: Arial, sans-serif;
}

.rx-panel[open] {
  display: flex;
  flex-direction: column;
}

.rx-panel::backdrop {
  background: rgba(6, 29, 69, 0.56);
  backdrop-filter: blur(2px);
}

.rx-panel *,
.rx-contact-dock * {
  box-sizing: border-box;
}

.rx-panel button,
.rx-contact-dock button {
  font: inherit;
  cursor: pointer;
}

.rx-panel-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: #092b62;
  color: #ffffff;
}

.rx-panel-brand {
  min-width: 0;
}

.rx-panel-wordmark {
  display: block;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.rx-panel-caption {
  display: block;
  margin-top: 3px;
  color: #dbeeff;
  font-size: 12px;
  line-height: 1.35;
}

.rx-close {
  display: inline-grid;
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.rx-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.rx-preview-banner {
  flex: 0 0 auto;
  padding: 9px 18px;
  border-bottom: 1px solid #e4b04d;
  background: #fff4d9;
  color: #5d3a00;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.rx-panel-tabs {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0 12px;
  border-bottom: 1px solid #cfdae8;
  background: #f4f7fb;
}

.rx-tab {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 12px 6px 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #355478;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}

.rx-tab[aria-selected="true"] {
  border-bottom-color: #087cff;
  color: #092b62;
}

.rx-tab:hover {
  color: #087cff;
}

.rx-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #ffffff;
}

.rx-panel [hidden] {
  display: none !important;
}

.rx-panel-title {
  margin: 0;
  color: #092b62;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.rx-panel-intro {
  margin: 8px 0 18px;
  color: #48627d;
  font-size: 14px;
  line-height: 1.5;
}

.rx-preview-form {
  margin: 0;
}

.rx-service-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rx-service-fieldset legend {
  margin-bottom: 8px;
}

.rx-fields > .rx-field {
  display: block;
}

.rx-service-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.rx-service-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #aebfd1;
  border-radius: 8px;
  background: #ffffff;
  color: #092b62;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
}

.rx-service-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.rx-service-option span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.rx-service-option span::before {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #6c849e;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.rx-service-option:has(input[type="radio"]:checked) {
  border-color: #087cff;
  background: #eaf4ff;
  color: #061d45;
  box-shadow: inset 0 0 0 1px #087cff;
}

.rx-service-option:has(input[type="radio"]:checked) span::before {
  border-color: #087cff;
  box-shadow: inset 0 0 0 3px #ffffff;
  background: #087cff;
}

.rx-service-option:has(input[type="radio"]:focus-visible) {
  outline: 3px solid #168fff;
  outline-offset: 2px;
}

.rx-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}

.rx-field {
  min-width: 0;
  color: #092b62;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.rx-field label {
  display: block;
  margin: 0 0 5px;
  color: #092b62;
  font-size: 13px;
  font-weight: 700;
}

.rx-field input,
.rx-field select,
.rx-field textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 6px 0 0;
  padding: 10px 11px;
  border: 1px solid #aebfd1;
  border-radius: 7px;
  outline: none;
  background: #ffffff;
  color: #061d45;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

.rx-field select {
  padding-right: 30px;
}

.rx-field textarea {
  height: 80px;
  resize: vertical;
}

.rx-field input::placeholder,
.rx-field textarea::placeholder,
.rx-chat-input::placeholder {
  color: #6c849e;
  opacity: 1;
}

.rx-field-wide {
  grid-column: 1 / -1;
}

.rx-field-note {
  margin: 5px 0 0;
  color: #5e7690;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.rx-submit,
.rx-inline-action {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid #087cff;
  border-radius: 7px;
  background: #087cff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.rx-submit:hover,
.rx-inline-action:hover,
.rx-chat-send:hover {
  border-color: #061d45;
  background: #061d45;
}

.rx-panel-footnote {
  margin: 12px 0 0;
  color: #5e7690;
  font-size: 12px;
  line-height: 1.45;
}

.rx-review {
  margin: 18px 0 0;
  padding: 16px;
  border-left: 4px solid #087cff;
  border-radius: 0 8px 8px 0;
  background: #eaf4ff;
}

.rx-review-title {
  margin: 0 0 12px;
  color: #092b62;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.rx-review-list {
  display: grid;
  grid-template-columns: minmax(84px, 0.48fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.rx-review-list dt {
  color: #092b62;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-transform: uppercase;
}

.rx-review-list dd {
  min-width: 0;
  margin: 0;
  color: #243f5c;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rx-review-notice {
  margin: 14px 0 0;
  padding: 10px 11px;
  border: 1px solid #e4b04d;
  border-radius: 6px;
  background: #fff4d9;
  color: #5d3a00;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.rx-secondary {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid #092b62;
  border-radius: 7px;
  background: #ffffff;
  color: #092b62;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.rx-secondary:hover {
  background: #eaf4ff;
}

.rx-review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.rx-review-actions .rx-submit,
.rx-review-actions .rx-inline-action {
  margin-top: 0;
}

.rx-chat-label {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #092b62;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.rx-chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
  max-height: 280px;
  margin: 12px 0;
  padding-right: 2px;
  overflow: auto;
  overscroll-behavior: contain;
}

.rx-message {
  max-width: 90%;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.rx-message-assistant {
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  background: #eaf4ff;
  color: #092b62;
}

.rx-message-user {
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  background: #092b62;
  color: #ffffff;
}

.rx-message-tag {
  display: block;
  margin-bottom: 4px;
  color: #5e7690;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.rx-message-user .rx-message-tag {
  color: #dbeeff;
}

.rx-message-text {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rx-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.rx-quick-reply {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #aebfd1;
  border-radius: 999px;
  background: #ffffff;
  color: #092b62;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.rx-quick-reply:hover {
  border-color: #087cff;
  background: #eaf4ff;
  color: #087cff;
}

.rx-chat-composer {
  display: flex;
  gap: 8px;
  margin: 16px 0 8px;
}

.rx-chat-input {
  display: block;
  min-width: 0;
  min-height: 44px;
  flex: 1 1 auto;
  padding: 10px;
  border: 1px solid #aebfd1;
  border-radius: 7px;
  outline: none;
  background: #ffffff;
  color: #061d45;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
}

.rx-chat-send {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #087cff;
  border-radius: 7px;
  background: #087cff;
  color: #ffffff;
}

.rx-chat-send svg {
  width: 20px;
  height: 20px;
}

.rx-chat-reset {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #48627d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rx-chat-reset:hover {
  color: #087cff;
}

.rx-contact-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin: 16px 0 0;
  color: #48627d;
  font-size: 13px;
  line-height: 1.45;
}

.rx-contact-inline a {
  color: #092b62;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rx-panel :is(button, input, select, textarea, a):focus-visible,
.rx-contact-dock :is(button, a):focus-visible {
  outline: 3px solid #168fff;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .rx-contact-dock {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-width: 380px;
  }

  .rx-dock-action {
    min-height: 54px;
    gap: 5px;
    padding: 8px 4px;
    font-size: 12px;
  }

  .rx-dock-action svg {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
  }

  .rx-panel {
    right: 12px;
    bottom: 90px;
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 108px);
  }

  .rx-panel-head {
    padding: 15px 16px;
  }

  .rx-panel-body {
    padding: 16px;
  }

  .rx-service-options,
  .rx-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .rx-review-list {
    grid-template-columns: minmax(72px, 0.42fr) minmax(0, 1fr);
    gap: 7px 9px;
  }
}

@media (max-width: 350px) {
  .rx-dock-action {
    font-size: 11px;
  }

  .rx-dock-action svg {
    display: none;
  }

  .rx-panel-title {
    font-size: 22px;
  }

  .rx-review-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rx-contact-dock *,
  .rx-panel * {
    transition: none !important;
  }
}

/* RX-MOBILE-USABILITY-480: appended mobile usability overrides. */
@media (max-width: 480px) {
  .rx-contact-dock {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .rx-contact-dock .rx-dock-action {
    min-height: 54px;
    font-size: 12px;
    font-weight: 700;
  }

  .rx-contact-dock .rx-dock-action svg {
    display: block;
    flex-basis: 18px;
    width: 18px;
    height: 18px;
  }

  .rx-contact-dock .rx-dock-action span {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  .rx-panel {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 108px - env(safe-area-inset-bottom, 0px));
  }

  .rx-panel .rx-field input,
  .rx-panel .rx-field select,
  .rx-panel .rx-field textarea,
  .rx-panel .rx-chat-input {
    font-size: 16px;
  }

  .rx-panel .rx-close {
    min-height: 44px;
    width: 44px;
    flex-basis: 44px;
  }

  .rx-panel .rx-quick-reply {
    min-height: 44px;
  }
}

/* Live request and Live AI states. */
.rx-submit:disabled,
.rx-chat-send:disabled,
.rx-secondary:disabled {
  cursor: wait;
  opacity: 0.68;
}
.rx-request-error,
.rx-chat-error {
  margin: 14px 0 0;
  padding: 10px 11px;
  border: 1px solid #d46b70;
  border-radius: 6px;
  background: #fff0f0;
  color: #86131b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
.rx-request-success {
  margin: 8px 0 0;
  color: #185b3f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.rx-chat-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.rx-chat-retry {
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 7px 11px;
  font-size: 12px;
}
.rx-chat-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed #b7c8da;
  border-radius: 8px;
  background: #f8fbff;
  color: #48627d;
  font-size: 13px;
  line-height: 1.45;
}
