/* SOL - virtual guide. Colors come from the site tokens plus the SOL tokens below. */
:root {
    --sol-sun: #f6b40e;
    --sol-sun-ink: #3d2a00;
    --sol-header-bg: var(--navy);
    --sol-header-ink: #ffffff;
    --sol-log-bg: var(--canvas);
    --sol-bot-bg: var(--surface);
    --sol-bot-ink: var(--ink);
    --sol-user-bg: #1167ad;
    --sol-user-ink: #ffffff;
    --sol-chip-ink: #0f5d9c;
    --sol-chip-border: #8fbfe3;
    --sol-tick: rgba(255, 255, 255, .65);
    --sol-tick-read: #a8ecff;
    --sol-error: #a61b1b;
    --sol-radius: 16px;
    --sol-radius-sm: 10px;
    --sol-shadow: 0 22px 54px rgba(11, 37, 69, .28);
    --sol-font: Arial, sans-serif;
}

html.dark {
    --sol-header-bg: #0c2a47;
    --sol-log-bg: #0a1f33;
    --sol-bot-bg: #143552;
    --sol-user-bg: #7fd0f2;
    --sol-user-ink: #062033;
    --sol-chip-ink: #9fdcf6;
    --sol-chip-border: #3f7aa3;
    --sol-tick: rgba(6, 32, 51, .55);
    --sol-tick-read: #0b4f8a;
    --sol-error: #ff9c9c;
    --sol-shadow: 0 22px 54px rgba(0, 0, 0, .5);
}

.sol-fab {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    bottom: 24px;
    box-shadow: var(--shadow);
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--sol-font);
    font-size: 14px;
    font-weight: 700;
    gap: 10px;
    padding: 6px 18px 6px 6px;
    position: fixed;
    right: 24px;
    z-index: 60;
    transition: transform .2s ease, box-shadow .2s ease;
}
.sol-fab[hidden] { display: none; }
.sol-fab:hover { transform: translateY(-2px); }
.sol-fab:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sol-fab[aria-expanded="true"] { display: none; }

.sol-fab__avatar,
.sol-chat__avatar {
    align-items: center;
    background: var(--sol-sun);
    border-radius: 50%;
    color: var(--sol-sun-ink);
    display: inline-flex;
    flex-shrink: 0;
    height: 44px;
    justify-content: center;
    width: 44px;
}
.sol-fab__avatar { animation: solPulse 2.6s ease-out infinite; }
.sol-fab__avatar svg,
.sol-chat__avatar svg { height: 26px; width: 26px; }

.sol-chat {
    background: var(--sol-log-bg);
    border: 1px solid var(--line);
    border-radius: var(--sol-radius);
    bottom: 24px;
    box-shadow: var(--sol-shadow);
    display: flex;
    flex-direction: column;
    font-family: var(--sol-font);
    height: min(600px, calc(100dvh - 48px));
    overflow: hidden;
    position: fixed;
    right: 24px;
    width: 380px;
    z-index: 70;
    animation: solOpen .22s ease-out;
}
.sol-chat[hidden] { display: none; }

.sol-chat__header {
    align-items: center;
    background: var(--sol-header-bg);
    color: var(--sol-header-ink);
    display: flex;
    gap: 10px;
    padding: 12px 10px 12px 14px;
}
.sol-chat__avatar { height: 40px; width: 40px; }
.sol-chat__title { display: flex; flex: 1; flex-direction: column; line-height: 1.3; min-width: 0; }
.sol-chat__title strong { font-size: 15px; }
.sol-chat__status { align-items: center; display: inline-flex; font-size: 12px; gap: 6px; opacity: .92; }
.sol-chat__dot { background: #4ade80; border-radius: 50%; height: 8px; width: 8px; }
.sol-chat__icon-button {
    background: none;
    border: 0;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    padding: 7px;
}
.sol-chat__icon-button svg { height: 20px; width: 20px; }
.sol-chat__icon-button:hover { background: rgba(255, 255, 255, .16); }
.sol-chat__icon-button:focus-visible { outline: 2px solid var(--sol-sun); outline-offset: 1px; }

.sol-chat__log {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 12px;
}

/* Chat-app bubbles: a tail on the first corner, the time and (for the guest) read ticks. */
.sol-msg {
    border-radius: var(--sol-radius-sm);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    font-size: 14px;
    line-height: 1.45;
    max-width: 86%;
    overflow-wrap: anywhere;
    padding: 8px 11px 5px;
    position: relative;
    animation: solMessage .22s ease-out;
}
.sol-msg::before {
    border-style: solid;
    content: "";
    position: absolute;
    top: 0;
}
.sol-msg--bot { align-self: flex-start; background: var(--sol-bot-bg); border-top-left-radius: 0; color: var(--sol-bot-ink); }
.sol-msg--bot::before { border-color: transparent var(--sol-bot-bg) transparent transparent; border-width: 0 8px 9px 0; left: -8px; }
.sol-msg--user { align-self: flex-end; background: var(--sol-user-bg); border-top-right-radius: 0; color: var(--sol-user-ink); }
.sol-msg--user::before { border-color: var(--sol-user-bg) transparent transparent transparent; border-width: 9px 8px 0 0; right: -8px; }
.sol-msg--notice { box-shadow: inset 4px 0 0 var(--sol-sun), 0 1px 2px rgba(0, 0, 0, .12); padding-left: 15px; }
.sol-msg--error { box-shadow: inset 4px 0 0 var(--sol-error), 0 1px 2px rgba(0, 0, 0, .12); padding-left: 15px; }
.sol-msg__text { display: block; white-space: pre-line; }
.sol-msg__meta {
    display: flex;
    font-size: 11px;
    gap: 4px;
    justify-content: flex-end;
    line-height: 1;
    margin-top: 3px;
    opacity: .72;
    white-space: nowrap;
}
.sol-msg__ticks { color: var(--sol-tick); font-weight: 700; letter-spacing: -3px; padding-right: 3px; transition: color .3s ease; }
.sol-msg__ticks.is-read { color: var(--sol-tick-read); }

.sol-typing { align-items: center; display: inline-flex; gap: 5px; min-height: 38px; padding: 12px 16px; }
.sol-typing span {
    animation: solTyping 1.3s infinite ease-in-out;
    background: var(--muted);
    border-radius: 50%;
    height: 8px;
    width: 8px;
}
.sol-typing span:nth-child(2) { animation-delay: .18s; }
.sol-typing span:nth-child(3) { animation-delay: .36s; }

.sol-chat.is-typing .sol-chat__status { font-style: italic; opacity: 1; }
.sol-chat.is-typing .sol-chat__dot { animation: solBlink 1s ease-in-out infinite; }

.sol-chat__options { display: flex; flex-wrap: wrap; gap: 6px; max-height: 40%; overflow-y: auto; padding: 0 12px; }
.sol-chat__options:not(:empty) { padding-bottom: 10px; }

.sol-chip {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--sol-chip-border);
    border-radius: 999px;
    color: var(--sol-chip-ink);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--sol-font);
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
    line-height: 1.2;
    padding: 8px 13px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.sol-chip:hover { background: var(--sol-user-bg); border-color: var(--sol-user-bg); color: var(--sol-user-ink); }
.sol-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sol-chip--primary { background: var(--sol-user-bg); border-color: var(--sol-user-bg); color: var(--sol-user-ink); }
.sol-chip--external::after { content: "↗"; font-weight: 400; }

.sol-chat__form {
    align-items: center;
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 10px;
}
.sol-chat__input {
    background: var(--sol-log-bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    flex: 1;
    font: inherit;
    font-size: 15px;
    min-width: 0;
    padding: 10px 15px;
}
.sol-chat__input:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 0; }
.sol-chat__input:disabled { cursor: not-allowed; opacity: .65; }
.sol-chat__input[aria-invalid="true"] { border-color: var(--sol-error); }
.sol-chat__send {
    align-items: center;
    background: var(--sol-user-bg);
    border: 0;
    border-radius: 50%;
    color: var(--sol-user-ink);
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    height: 42px;
    justify-content: center;
    width: 42px;
}
.sol-chat__send svg { height: 19px; width: 19px; }
.sol-chat__send:disabled { cursor: not-allowed; opacity: .5; }
.sol-chat__send:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sol-chat__send[aria-busy="true"] svg { animation: solSpin 1s linear infinite; }

.sol-chat__error {
    background: var(--surface);
    color: var(--sol-error);
    font-size: 13px;
    margin: 0;
    padding: 0 14px 10px;
}
.sol-chat__error[hidden] { display: none; }

@keyframes solOpen { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes solMessage { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes solTyping { 0%, 60%, 100% { opacity: .45; transform: none; } 30% { opacity: 1; transform: translateY(-5px); } }
@keyframes solBlink { 50% { opacity: .35; } }
@keyframes solPulse { 0% { box-shadow: 0 0 0 0 rgba(246, 180, 14, .55); } 75% { box-shadow: 0 0 0 14px rgba(246, 180, 14, 0); } 100% { box-shadow: 0 0 0 0 rgba(246, 180, 14, 0); } }
@keyframes solSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .sol-chat, .sol-msg, .sol-typing span, .sol-fab__avatar, .sol-chat__send[aria-busy="true"] svg, .sol-chat.is-typing .sol-chat__dot { animation: none; }
    .sol-typing span:nth-child(2) { opacity: .7; }
    .sol-typing span:nth-child(3) { opacity: .45; }
}

@media (max-width: 600px) {
    .sol-fab { bottom: 16px; right: 16px; }
    .sol-fab__label { display: none; }
    .sol-fab { padding: 6px; }
    .sol-chat { border-radius: 14px; bottom: 12px; height: calc(100dvh - 24px); left: 12px; right: 12px; width: auto; }
    /* 16px keeps iOS from zooming into the field on focus. */
    .sol-chat__input { font-size: 16px; }
}
