/* Roxy, the help assistant on the Today page (Shared/RoxyAssistant.razor). Colours follow Docs/Roxy. */
.rx-assistant {
    --rx-ink: #07122b;
    --rx-text: #1e293b;
    --rx-muted: #56637a;
    --rx-line: #e1e7f0;
    --rx-blue: #2f6bff;
    --rx-blue-deep: #1747d6;
    --rx-blue-soft: #eef3ff;
    --rx-card: #ffffff;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    color: var(--rx-text);
    pointer-events: none;
}
.rx-assistant > * { pointer-events: auto; }

/* Launcher */
.rx-launcher {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 18px 5px 5px;
    border: 0;
    border-radius: 999px;
    background: var(--rx-blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(23, 71, 214, .28);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.rx-launcher:hover { background: var(--rx-blue-deep); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(23, 71, 214, .32); }
.rx-launcher:focus-visible { outline: 3px solid #93b4ff; outline-offset: 3px; }
.rx-launcher-face { display: block; width: 44px; height: 44px; overflow: hidden; border: 2px solid #fff; border-radius: 50%; background: #dfe6f2; }

/* Panel */
.rx-panel {
    display: flex;
    flex-direction: column;
    width: min(400px, calc(100vw - 32px));
    max-height: min(640px, calc(100vh - 120px));
    overflow: hidden;
    border: 1px solid var(--rx-line);
    border-radius: 18px;
    background: var(--rx-card);
    box-shadow: 0 24px 60px rgba(7, 18, 43, .22), 0 2px 6px rgba(7, 18, 43, .08);
    animation: rx-in .22s ease-out;
}
@keyframes rx-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.rx-head { display: flex; align-items: flex-end; gap: 12px; padding: 12px 12px 0 14px; border-bottom: 1px solid var(--rx-line); background: linear-gradient(180deg, var(--rx-blue-soft), #fff); }
.rx-stage { flex: none; width: 104px; height: 104px; margin-bottom: -1px; }
.rx-title { flex: 1; min-width: 0; padding-bottom: 14px; }
.rx-title h2 { margin: 0; color: var(--rx-ink); font-size: 1.15rem; font-weight: 800; }
.rx-title p { margin: 2px 0 0; color: var(--rx-muted); font-size: .82rem; line-height: 1.35; }
.rx-close { align-self: flex-start; display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--rx-muted); cursor: pointer; }
.rx-close:hover { background: rgba(7, 18, 43, .06); color: var(--rx-ink); }
.rx-close:focus-visible, .rx-send:focus-visible, .rx-suggestions button:focus-visible, .rx-results a:focus-visible, .rx-academy-link:focus-visible { outline: 2px solid var(--rx-blue); outline-offset: 2px; }
.rx-close svg, .rx-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.rx-log { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 120px; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.rx-msg { display: grid; gap: 8px; max-width: 88%; }
.rx-msg p { margin: 0; padding: 9px 12px; border-radius: 14px; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.rx-msg.is-roxy { align-self: flex-start; }
.rx-msg.is-roxy p { border-bottom-left-radius: 4px; background: #f1f4fa; color: var(--rx-text); }
.rx-msg.is-user { align-self: flex-end; }
.rx-msg.is-user p { border-bottom-right-radius: 4px; background: var(--rx-blue); color: #fff; }
.rx-typing:empty::after { content: "…"; color: var(--rx-muted); }

.rx-results { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rx-results a { display: grid; gap: 1px; padding: 8px 11px; border: 1px solid var(--rx-line); border-radius: 10px; background: #fff; color: var(--rx-ink); text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.rx-results a:hover { border-color: #9db8ff; background: var(--rx-blue-soft); }
.rx-results a.is-best { border-color: #9db8ff; box-shadow: inset 3px 0 0 var(--rx-blue); }
.rx-result-title { font-size: .87rem; font-weight: 700; }
.rx-result-meta { color: var(--rx-muted); font-size: .75rem; }
.rx-academy-link { justify-self: start; color: var(--rx-blue-deep); font-size: .84rem; font-weight: 700; }

.rx-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.rx-suggestions button { padding: 6px 11px; border: 1px solid #c9d7f5; border-radius: 999px; background: var(--rx-blue-soft); color: var(--rx-blue-deep); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.rx-suggestions button:hover:not(:disabled) { border-color: var(--rx-blue); }

.rx-composer { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--rx-line); }
.rx-composer input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #cfd8e6; border-radius: 10px; background: #fff; color: var(--rx-ink); font: inherit; font-size: .92rem; }
.rx-composer input:focus { border-color: var(--rx-blue); outline: 0; box-shadow: 0 0 0 3px rgba(47, 107, 255, .18); }
.rx-send { display: grid; width: 42px; place-items: center; border: 0; border-radius: 10px; background: var(--rx-blue); color: #fff; cursor: pointer; }
.rx-send:disabled { background: #b8c7ec; cursor: default; }

.rx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
    .rx-assistant { right: 12px; bottom: 12px; left: 12px; }
    /* Clear of the portal's top bar (about 64px) and the launcher below. */
    .rx-panel { width: 100%; max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); }
    .rx-stage { width: 84px; height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
    .rx-panel { animation: none; }
    .rx-launcher, .rx-results a { transition: none; }
}
