/* Guest surfaces: kiosk tablet and website widget.
   Large touch targets, no navigation, nothing to configure. */

.guest-body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
}

.guest-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: clamp(16px, 4vw, 48px);
}

.guest-screen {
    display: grid;
    justify-items: center;
    gap: 18px;
    width: min(100%, 720px);
    text-align: center;
}

.guest-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--line);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: guest-spin 0.8s linear infinite;
}

@keyframes guest-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .guest-spinner { animation: none; }
}

.guest-title {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.guest-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.guest-notice {
    max-width: 46ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.guest-error {
    min-height: 1.4em;
    margin: 0;
    color: var(--danger);
    font-weight: 650;
}

/* Deliberately oversized: a visitor uses this once, standing up, without
   instructions. */
.guest-start {
    min-height: 72px;
    min-width: min(100%, 320px);
    border: 1px solid transparent;
    border-radius: 18px;
    padding: 18px 32px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
}

.guest-start {
    color: var(--ink);
    background: var(--lime);
}

.guest-start:hover:not(:disabled) {
    background: #cce967;
}

.guest-start:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.guest-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
    color: white;
    background: var(--danger);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}
.guest-close:hover { background: #8f1c13; }

.guest-video-stage {
    position: relative;
    width: min(100%, 640px, calc(100dvh - 180px));
    min-width: 0;
    aspect-ratio: 1;
    border-radius: 24px;
    overflow: hidden;
    background: #11101d;
}

.guest-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The face the visitor is about to speak to. Smaller than the conversation
   video: it introduces the assistant, it is not the thing being watched. */
.guest-poster-button {
    width: min(100%, 220px);
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.guest-poster-button:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

.guest-poster {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    background: #11101d;
    object-fit: cover;
}

/* Same on-video placement as the public demo, using the shared badge colours. */
.guest-state {
    position: absolute;
    top: auto;
    right: auto;
    bottom: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
    margin: 0;
    font-size: 0.85rem;
}

.guest-caption {
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-align: left;
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.6;
}
.guest-caption span { display: inline-block; }
.guest-caption.is-overflowing span {
    animation: guest-caption-scroll var(--caption-duration) linear infinite alternate;
}
@keyframes guest-caption-scroll {
    0%, 10% { transform: translateX(0); }
    90%, 100% { transform: translateX(var(--caption-offset)); }
}
@media (prefers-reduced-motion: reduce) {
    .guest-caption.is-overflowing { overflow-x: auto; }
    .guest-caption.is-overflowing span { animation: none; }
}
.guest-caption:empty, .guest-error:empty { display: none; }

.guest-pair-form {
    display: grid;
    gap: 14px;
    justify-items: center;
}

.guest-pair-form input {
    width: min(100%, 280px);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-align: center;
}


/* The snippet does not dictate the frame's width, so a customer may give the
   widget far more room than it needs. Keep it column-shaped regardless. */
.guest-widget .guest-screen {
    width: min(100%, 380px);
}

.guest-widget .guest-title {
    font-size: 1.4rem;
}


.guest-widget .guest-poster-button {
    max-width: 112px;
}

.guest-widget .guest-start {
    min-height: 52px;
    min-width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
}

.guest-widget .guest-notice {
    font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
    .guest-start {
        transition: none;
    }
}

/* The demo shares the kiosk screen, within the shorter popup viewport. */
.guest-demo .guest-shell { padding: 16px; min-height: 100dvh; }
.guest-demo .guest-screen { gap: 12px; }

.guest-demo .guest-start { min-height: 48px; padding: 10px 20px; font-size: 1rem; }

/* Topics the assistant can actually answer, listed while it waits. */
.guest-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.guest-topics-lead {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Tappable: on a tablet with no keyboard this is the quickest way in, and the
   only way at all for a visitor who will not speak to a machine. */
.guest-topic {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 16px;
    color: var(--ink);
    background: var(--surface, #fff);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.guest-topic:hover:not(:disabled) {
    border-color: var(--ink);
}

.guest-topic:disabled {
    color: var(--muted);
    opacity: 0.55;
    cursor: default;
}

.guest-widget .guest-topic {
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 7px 12px;
    font-size: 0.82rem;
}

.guest-results {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 8px 12px;
}
.guest-result-link {
    display: grid;
    justify-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface, #fff);
    color: var(--ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}
.guest-result-link img { display: block; background: white; }
.guest-widget .guest-result-link { min-height: 44px; background: var(--lime); }

/* Typed questions use the same conversation as speech and suggestions. */
.guest-text-form {
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
    text-align: left;
}

.guest-text-form label { font-size: 0.85rem; font-weight: 650; }
.guest-text-row { display: flex; gap: 8px; min-width: 0; }
.guest-text-form input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--surface, #fff);
    font: inherit;
    font-size: 16px;
}
.guest-text-row input { flex: 1; }
.guest-text-row button {
    flex: 0 0 auto;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--ink);
    background: var(--lime);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}
.guest-text-row button:disabled { opacity: 0.55; cursor: not-allowed; }
.guest-voice-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 0.9rem;
    cursor: pointer;
}
.guest-voice-choice input { width: 20px; height: 20px; }
.guest-widget .guest-shell { height: 100dvh; min-height: 0; padding: 0; overflow: auto; }
.guest-widget .guest-screen:not(.guest-live) { padding: 16px; }
.guest-widget .guest-screen { min-width: 0; gap: 8px; }

.guest-widget .guest-topics {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
}

.guest-widget .guest-topics li { max-width: 100%; min-width: 0; }
.guest-widget .guest-start {
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 16px;
}
.guest-widget .guest-state { max-width: 100%; font-size: 0.85rem; overflow-wrap: anywhere; }
.guest-widget .guest-subtitle { overflow-wrap: anywhere; }
.guest-widget .guest-error:empty { display: none; }
/* Keep video and composer fixed; messages and suggestions scroll together. */
.guest-widget .guest-live {
    width: 100%;
    align-self: stretch;
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
}
.guest-conversation-content {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    min-height: 0;
    overflow: hidden;
}
.guest-conversation-header {
    display: grid;
    border-bottom: 1px solid var(--line);
}
.guest-widget .guest-video-stage {
    width: 100%;
    height: min(100vw, calc(100dvh - 180px));
    aspect-ratio: auto;
    border-radius: 0;
    background: var(--canvas);
}
.guest-widget .guest-video {
    object-fit: contain;
    object-position: center;
}
.guest-chat-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 12px;
    text-align: left;
}
.guest-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.guest-message {
    align-self: flex-start;
    max-width: 92%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px 14px 14px 4px;
    background: var(--surface, #fff);
    overflow-wrap: anywhere;
}
.guest-message strong { display: block; margin-bottom: 4px; font-size: 0.75rem; }
.guest-message p { margin: 0; white-space: pre-wrap; font-size: 0.9rem; line-height: 1.5; }
.guest-message-user {
    align-self: flex-end;
    border-radius: 14px 14px 4px 14px;
    background: var(--lime);
}
.guest-message-notice { color: var(--muted); background: transparent; }
.guest-chat-suggestions { width: 100%; min-width: 0; }
.guest-chat-suggestions:has(> [hidden]) { display: none; }
.guest-chat-suggestions .guest-topics { justify-content: flex-start; padding: 0; }
.guest-chat-suggestions .guest-topics li { max-width: 100%; }
.guest-chat-suggestions .guest-topic {
    display: block;
    min-height: 36px;
    max-width: 100%;
    padding: 7px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.guest-chat-suggestions .guest-topic:disabled { opacity: 0.7; }
.guest-composer {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--line);
    background: var(--canvas);
}

.guest-widget-compact .guest-poster-button { max-width: 160px; }
.guest-widget-card .guest-screen { width: min(100%, 640px); }

.guest-widget-card .guest-poster-button { max-width: 180px; }
@media (max-height: 620px) {
    .guest-widget .guest-poster-button { max-width: 104px; }
}
