/* Ronyxx Help (round 58): the face button, bottom right, always in view; the chat above it (a full screen on phones).
   Its own colours, light and dark (the console's dark theme sets data-theme="dark" on <html>). */
.rxa {
  --rxa-bg: #ffffff; --rxa-fg: #0a0a0a; --rxa-muted: #5c5c58; --rxa-line: #e6e6e2; --rxa-soft: #f3f3f1; --rxa-or: #ff5a1f;
  --rxa-orange-text: #c2410c; --rxa-me: #0a0a0a; --rxa-me-fg: #ffffff; --rxa-shadow: rgba(10, 10, 10, .18); --rxa-skin: #0a0a0a;
  --rxa-err: #b42318;
  --rxa-gap: max(16px, env(safe-area-inset-right, 0px));
  --rxa-low: max(16px, env(safe-area-inset-bottom, 0px));
  position: fixed; right: var(--rxa-gap); bottom: var(--rxa-low); z-index: 45;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.45; color: var(--rxa-fg);
  -webkit-font-smoothing: antialiased; text-align: left;
}
html[data-theme="dark"] .rxa {
  --rxa-bg: #141413; --rxa-fg: #f4f4f1; --rxa-muted: #a3a39e; --rxa-line: #2a2a28; --rxa-soft: #1f1f1d; --rxa-orange-text: #ff8a5c;
  --rxa-me: #ff5a1f; --rxa-me-fg: #0a0a0a; --rxa-shadow: rgba(0, 0, 0, .5); --rxa-skin: #0a0a0a; --rxa-err: #ff8b80;
}
.rxa *, .rxa *::before, .rxa *::after { box-sizing: border-box; }

/* the button: the face itself */
.rxa-launch {
  position: relative; display: block; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 17px; background: transparent; cursor: pointer;
  box-shadow: 0 10px 28px var(--rxa-shadow), 0 0 0 1px rgba(255, 255, 255, .10); transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.rxa-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 32px var(--rxa-shadow), 0 0 0 1px rgba(255, 255, 255, .14); }
.rxa-launch:active { transform: scale(.96); }
.rxa-launch:focus-visible { outline: 3px solid var(--rxa-or); outline-offset: 3px; }
.rxa-face { display: block; }
.rxa-face-big { width: 58px; height: 58px; }
.rxa-face-small { width: 36px; height: 36px; flex: none; }
.rxa-skin { fill: var(--rxa-skin); }
.rxa-eye { fill: #ff5a1f; transform-box: fill-box; transform-origin: center; animation: rxa-blink 5.2s infinite; }
.rxa-eye + .rxa-eye { animation-delay: .02s; }
.rxa-smile { fill: none; stroke: #ff5a1f; stroke-width: 2.6; stroke-linecap: round; }
.rxa-eyes { transition: transform .3s ease; }
@keyframes rxa-blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.12); } }
.rxa-thinking .rxa-eyes { animation: rxa-look 1.4s ease-in-out infinite; }
@keyframes rxa-look { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(2.2px); } 70% { transform: translateX(-2.2px); } }
.rxa[data-open] .rxa-launch .rxa-eyes { transform: translateY(1px); }

/* "Questions? Ask me": once, a moment after the page opens, on wide screens */
.rxa-tip {
  position: absolute; right: 70px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; pointer-events: none;
  background: var(--rxa-bg); color: var(--rxa-fg); border: 1px solid var(--rxa-line); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px var(--rxa-shadow); opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.rxa-launch:hover .rxa-tip, .rxa.rxa-hint .rxa-tip { opacity: 1; transform: translate(0, -50%); }
.rxa[data-open] .rxa-tip { opacity: 0 !important; }

/* the chat */
.rxa-panel {
  position: absolute; right: 0; bottom: 72px; width: min(390px, calc(100vw - 32px)); height: min(620px, calc(100vh - 120px)); height: min(620px, calc(100dvh - 120px));
  display: flex; flex-direction: column; background: var(--rxa-bg); color: var(--rxa-fg); border: 1px solid var(--rxa-line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px var(--rxa-shadow); opacity: 0; transform: translateY(10px) scale(.985); transform-origin: bottom right;
  transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.rxa-panel[hidden] { display: none; }
.rxa-panel.rxa-in { opacity: 1; transform: none; }
.rxa-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 14px; color: #ffffff; background-color: #0a0a0a;
  background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 22px 22px;
}
.rxa-head .rxa-skin { fill: #1c1c1a; }
.rxa-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rxa-names { display: grid; min-width: 0; }
.rxa-names strong { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.rxa-names span { font-size: 12.5px; color: #a3a39e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rxa-hacts { display: flex; gap: 4px; flex: none; }
.rxa-hbtn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #d6d6d2; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.rxa-hbtn:hover { background: rgba(255, 255, 255, .1); color: #ffffff; }
.rxa-hbtn:focus-visible { outline: 2px solid var(--rxa-or); outline-offset: 1px; }
.rxa-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.rxa-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.rxa-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; overflow-wrap: anywhere; animation: rxa-rise .18s ease both; }
@keyframes rxa-rise { from { opacity: 0; transform: translateY(4px); } }
.rxa-bot { align-self: flex-start; background: var(--rxa-soft); border-bottom-left-radius: 5px; }
.rxa-me { align-self: flex-end; background: var(--rxa-me); color: var(--rxa-me-fg); border-bottom-right-radius: 5px; }
.rxa-msg p { margin: 0; }
.rxa-hidden { font-style: italic; opacity: .8; }
.rxa-text { display: grid; gap: 7px; }
.rxa-text ul, .rxa-text ol { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.rxa-text b { font-weight: 600; }
.rxa-link { color: var(--rxa-orange-text); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
@media (hover: hover) { .rxa-link:hover { color: var(--rxa-fg); } }
.rxa-me .rxa-link { color: inherit; }
.rxa-typing { display: flex; gap: 5px; padding: 13px 14px; }
.rxa-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--rxa-muted); opacity: .5; animation: rxa-dot 1s ease-in-out infinite; }
.rxa-typing i:nth-child(2) { animation-delay: .15s; } .rxa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rxa-dot { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-3px); opacity: .9; } }

.rxa-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.rxa-chips[hidden] { display: none; }
.rxa-chip {
  border: 1px solid var(--rxa-line); background: var(--rxa-bg); color: var(--rxa-fg); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13.5px; line-height: 1.25;
  cursor: pointer; text-align: left; transition: border-color .15s ease, background-color .15s ease;
}
.rxa-chip:hover { border-color: var(--rxa-or); }
.rxa-chip:focus-visible { outline: 2px solid var(--rxa-or); outline-offset: 1px; }

.rxa-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 12px; border: 1.5px solid var(--rxa-line); border-radius: 14px; background: var(--rxa-bg); transition: border-color .15s ease, box-shadow .15s ease; }
.rxa-form:focus-within { border-color: var(--rxa-fg); box-shadow: 0 0 0 4px rgba(255, 90, 31, .14); }
.rxa-input { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--rxa-fg); font: inherit; font-size: 16px; line-height: 1.4; padding: 7px 0; max-height: 120px; }
.rxa-input::placeholder { color: var(--rxa-muted); }
.rxa-send { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--rxa-or); color: #0a0a0a; cursor: pointer; transition: transform .12s ease, opacity .15s ease; }
.rxa-send:active { transform: scale(.94); }
.rxa-send:disabled { opacity: .45; cursor: default; }
.rxa-send:focus-visible { outline: 2px solid var(--rxa-fg); outline-offset: 2px; }
.rxa-fine { margin: 0; padding: 8px 14px 12px; font-size: 12px; color: var(--rxa-muted); }
.rxa-person { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-weight: 600; color: var(--rxa-orange-text); cursor: pointer; }
@media (hover: hover) { .rxa-person:hover { color: var(--rxa-fg); } }
.rxa-person:focus-visible { outline: 2px solid var(--rxa-or); outline-offset: 2px; border-radius: 3px; }

/* (round 62) talk to a person: a short form in the chat */
.rxa-hand { align-self: stretch; max-width: 100%; padding: 14px; background: var(--rxa-bg); border: 1px solid var(--rxa-line); border-radius: 14px; border-bottom-left-radius: 5px; }
.rxa-hform { display: grid; gap: 12px; margin: 0; }
.rxa-htop { display: flex; align-items: center; gap: 8px; }
.rxa-htop strong { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.rxa-hic { width: 18px; height: 18px; color: var(--rxa-orange-text); flex: none; }
.rxa-hsub, .rxa-hto { margin: -4px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--rxa-muted); }
.rxa-hto { margin: 0; }
.rxa-hto b { color: var(--rxa-fg); font-weight: 600; overflow-wrap: anywhere; }
.rxa-hfield { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--rxa-fg); }
.rxa-hfield input, .rxa-hfield textarea {
  display: block; width: 100%; margin: 0; border: 1.5px solid var(--rxa-line); border-radius: 10px; background: var(--rxa-bg); color: var(--rxa-fg);
  font: inherit; font-size: 16px; line-height: 1.4; padding: 9px 11px; outline: 0; resize: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.rxa-hfield input::placeholder { color: var(--rxa-muted); }
.rxa-hfield input:focus, .rxa-hfield textarea:focus { border-color: var(--rxa-fg); box-shadow: 0 0 0 4px rgba(255, 90, 31, .14); }
.rxa-hfield [aria-invalid="true"] { border-color: var(--rxa-err); }
.rxa-herr { margin: 0; font-size: 13px; color: var(--rxa-err); }
.rxa-hsend {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; border: 0; border-radius: 10px; padding: 0 16px;
  background: var(--rxa-or); color: #0a0a0a; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .12s ease, opacity .15s ease;
}
.rxa-hsend:active { transform: scale(.98); }
.rxa-hsend:disabled { opacity: .6; cursor: default; }
.rxa-hsend:focus-visible { outline: 2px solid var(--rxa-fg); outline-offset: 2px; }

/* phones: the chat takes the whole screen; the button stays out of the way of the page's own buttons */
@media (max-width: 640px) {
  .rxa { --rxa-gap: max(12px, env(safe-area-inset-right, 0px)); --rxa-low: max(12px, env(safe-area-inset-bottom, 0px)); }
  .rxa-launch, .rxa-face-big { width: 50px; height: 50px; }
  .rxa-launch { border-radius: 15px; transition: transform .18s cubic-bezier(.2, .8, .2, 1), opacity .18s ease; }
  /* typing in the page's own form (the keyboard is up): the button steps aside until it's done */
  .rxa.rxa-away:not([data-open]) .rxa-launch { opacity: 0; transform: scale(.7); pointer-events: none; }
  .rxa-tip { display: none; }
  .rxa[data-open] { inset: 0; right: 0; bottom: 0; }
  .rxa[data-open] .rxa-launch { display: none; }
  .rxa-panel {
    position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); transform: translateY(16px);
  }
  .rxa-head { padding-top: 12px; }
  html.rxa-opened, html.rxa-opened body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .rxa-eye, .rxa-thinking .rxa-eyes, .rxa-typing i, .rxa-msg { animation: none !important; }
  .rxa-panel, .rxa-launch, .rxa-tip { transition: none !important; }
}
.rxa-room { height: 64px; }
/* (round 59) the console on a phone: the button sits just above its bottom bar, or above the setup's buttons */
@media (max-width: 640px) {
  html.rx-bnav .rxa:not([data-open]) { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  html.rx-wiz .rxa:not([data-open]) { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .rxa, .rxa-room { display: none !important; } }
