/* Scoped presentation. Keep the native search, labels and controls intact. */
@layer redicoReadability {
  html body #rxmax-dialog .rxmax-brand {
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr) !important;
    grid-template-rows: auto auto;
    gap: 4px 12px !important;
    min-width: 0;
  }
  html body #rxmax-dialog .rxmax-brand > .rxmax-emblem {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
  }
  html body #rxmax-dialog .rxmax-brand > .rxmax-emblem.rd-robot {
    position: relative;
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    pointer-events: none;
    letter-spacing: normal !important;
    animation: none !important;
  }
  html body #rxmax-dialog .rxmax-brand > span:not(.rxmax-emblem):not(.rxmax-scope) {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    min-width: 0;
  }
  html body #rxmax-dialog .rxmax-brand > .rxmax-scope {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    padding-left: 0 !important;
    border-left: 0 !important;
    white-space: normal;
  }
  html body #rxmax-dialog .rd-robot .rd-robot__body {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: 50% 88%;
    animation: none !important;
  }
  html body #rxmax-dialog .rd-robot .rd-robot__image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  html body #rxmax-dialog .rd-robot .rd-robot__status {
    position: absolute;
    right: 4px;
    bottom: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mx-red, #b42330);
    outline: 2px solid var(--mx-bg, #f4f5f6);
    opacity: 0.35;
    transition: opacity 160ms ease;
  }
  html body #rxmax-dialog .rd-robot:is([data-state="focused"], [data-state="typing"]) .rd-robot__status { opacity: 0.8; }
  html body #rxmax-dialog .rd-robot[data-state="searching"] .rd-robot__status { opacity: 1; }
  html body #rxmax-dialog .rd-robot[data-rd-robot-paused] .rd-robot__status { transition: none !important; }

  html body img.rd-robot-asset {
    object-fit: contain !important;
    background: transparent !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  html body #rd-approved-chrome img.header-bot.rd-robot-asset,
  html body img.header-bot.rd-robot-asset {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
  }
  html body .redico-assistant__avatar img.rd-robot-asset {
    width: 49px !important;
    height: 49px !important;
  }
  html body .redico-assistant__avatar.rd-robot-avatar::after { animation: none !important; }

  @media (max-width: 700px) {
    html body #rxmax-dialog .rxmax-brand { grid-template-columns: 64px minmax(0, 1fr) !important; gap: 4px 10px !important; }
    html body #rxmax-dialog .rxmax-brand > .rxmax-emblem { width: 64px !important; height: 64px !important; min-width: 64px !important; }
    html body #rxmax-dialog.rxhs-inline .rxmax-brand { grid-template-rows: 1fr; }
    html body #rxmax-dialog.rxhs-inline .rxmax-brand > .rxmax-emblem { grid-row: 1; }
    html body #rxmax-dialog.rxhs-inline .rxmax-brand > span:not(.rxmax-emblem):not(.rxmax-scope) { align-self: center; }
  }
  @media (prefers-reduced-motion: reduce) {
    html body #rxmax-dialog .rd-robot .rd-robot__body,
    html body #rxmax-dialog .rd-robot .rd-robot__status {
      animation: none !important;
      transition: none !important;
      transform: none !important;
    }
  }
}

/* This existing early layer owns the header's important icon dimensions. */
@layer redicoCompact.rdTypeface {
  html body.rd-approved-design #rd-approved-chrome .masthead .global-trigger > img.header-bot:is(.rd-robot-asset,.rd-robot-reserved) {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    flex-basis: 32px !important;
    flex-shrink: 0 !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
