/*
 * "classic" chat style: the original widget look, as on ptools.com/ask (pill input, chips, input fixed
 * to the bottom of the window while chatting). Markup: Views/TeraveraChatUI/_Chat.cshtml.
 */

/* Ensure [hidden] always works regardless of site CSS resets */
.tvc [hidden] { display: none !important; }
[hidden]       { display: none !important; }

/* ── Design tokens ────────────────────────────────────────────────────────── */
.tvc {
    --tvc-bg:                  #fff;
    --tvc-hero-bg:             #fff;
    --tvc-text:                #1a1a1a;
    --tvc-text-muted:          #666;
    --tvc-text-subtle:         #999;
    --tvc-text-placeholder:    #aaa;
    --tvc-border:              #e0e0e0;
    --tvc-border-inner:        #f0f0f0;
    --tvc-chip-border:         #ddd;
    --tvc-send-bg:             #1a1a1a;
    --tvc-user-bubble-bg:      #f4f4f4;
    --tvc-assistant-bubble-bg: #f4f4f4;
    --tvc-input-bg:            #fafafa;
    --tvc-online:              #2ecc71;
    --tvc-margin-bottom:       2.5rem;
}

/* ── Widget shell ─────────────────────────────────────────────────────────── */
.tvc {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-radius: 1rem;
    background: var(--tvc-bg);
    color: var(--tvc-text);
    margin-bottom: var(--tvc-margin-bottom);
    font-family: inherit;
    font-size: 0.9375rem;
    box-sizing: border-box;
}

/* ── Hero mode ────────────────────────────────────────────────────────────── */
.tvc--hero {
    height: auto;
    border: none;
    box-shadow: none;
    background: var(--tvc-hero-bg);
    border-radius: 0;
    align-items: center;
}

/* Hero page: when chat is active, center the whole widget */
.tvc--hero-page.tvc--chat-active {
    max-width: 48rem;
    margin: 0 auto;
}

/* ── Hero section ─────────────────────────────────────────────────────────── */
.tvc__hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 48rem;
    text-align: center;
}

.tvc__hero-heading {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 2.5rem;
    color: var(--tvc-text);
    line-height: 1.3;
}

/* Hero form wraps the input + send button */
.tvc__hero-form {
    width: 100%;
    position: relative;
}

.tvc__hero-input-wrap {
    position: relative;
    width: 100%;
}

/* First-screen input: the same inset as the chat input */
.tvc__hero-form .tvc__input {
    width: 100%;
    box-sizing: border-box;
    height: 3.5rem;
    padding: 0 3.25rem 0 1.125rem;
    border: 1px solid var(--tvc-border);
    border-radius: 1.875rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--tvc-text);
    background: var(--tvc-input-bg);
    outline: none;
    transition: border-color .15s;
}
.tvc__hero-form .tvc__input:focus {
    border-color: var(--tvc-text-placeholder);
    background: var(--tvc-bg);
}

/* Hero send button — dark circle, absolutely positioned inside the input wrap */
.tvc__hero-send {
    position: absolute;
    right: 0.5rem;
    top: 1.75rem; /* half the input height: the form grows when the model menu sits under the input */
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: var(--tvc-send-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .15s;
    padding: 0;
    flex-shrink: 0;
}
.tvc__hero-send:hover:not(:disabled) { opacity: .85; }
.tvc__hero-send:disabled { opacity: .45; cursor: default; }
.tvc__hero-send svg { width: 1.125rem; height: 1.125rem; }

/* ── Preset chips (hero) ─────────────────────────────────────────────────── */
.tvc__presets {
    width: 100%;
    box-sizing: border-box;
}

.tvc__hero-section .tvc__presets {
    padding: 0;
    margin-top: 2rem;
}

.tvc__presets-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tvc-text-subtle);
    margin-bottom: 0.5rem;
    text-align: center;
}

.tvc__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tvc__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--tvc-chip-border);
    border-radius: 1.25rem;
    background: var(--tvc-bg);
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--tvc-text);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.tvc__chip:hover {
    background: var(--tvc-assistant-bubble-bg);
    border-color: var(--tvc-text-placeholder);
}

.tvc__chip-star {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    display: none;
}

/* ── Disclaimers ─────────────────────────────────────────────────────────── */
.tvc__disclaimers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
    margin-top: 3.5rem;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .tvc__disclaimers { grid-template-columns: 1fr; }
}

/* The markup splits the cards into two columns (first half, second half) for the portal look; here
   they flow back into one grid, in their original order. */
.tvc__disclaimers-col { display: contents; }

.tvc__disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    text-align: left;
    color: var(--tvc-text);
    font-size: 0.875rem;
    line-height: 1.45;
    border: 1px solid var(--tvc-border);
    border-radius: 0.625rem;
    padding: 1.125rem 1.25rem;
    background: var(--tvc-bg);
    box-sizing: border-box;
}
.tvc__disclaimer svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.0625rem;
    fill: var(--tvc-text);
}
.tvc__disclaimer p { margin: 0; }

/* ── Chat section ─────────────────────────────────────────────────────────── */
.tvc__chat-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.tvc__toolbar {
    display: none;
    justify-content: flex-start;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem 0;
}
.tvc--chat-active .tvc__toolbar {
    display: flex;
}

.tvc__toolbar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--tvc-text);
    flex: 1;
}

/* New-chat button floats to top-right, beside the page title */
.tvc--chat-active .tvc__newchat {
    position: absolute;
    top: -6rem;
    right: 0;
    z-index: 10;
}
.tvc--chat-active {
    position: relative;
}

.tvc__newchat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--tvc-border);
    border-radius: 0.5rem;
    background: var(--tvc-bg);
    color: var(--tvc-text);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.tvc__newchat:hover {
    background: var(--tvc-assistant-bubble-bg);
    border-color: var(--tvc-text-placeholder);
}
.tvc__newchat svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* ── Messages area ───────────────────────────────────────────────────────── */
.tvc__messages {
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tvc__msg               { display: flex; max-width: 100%; }
.tvc__msg--user         { flex-direction: row-reverse; }
.tvc__msg--assistant    { flex-direction: row; }

/* ── Bubbles ─────────────────────────────────────────────────────────────── */
.tvc__bubble {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.875rem;
    border-radius: 1.125rem;
    max-width: 72%;
    line-height: 1.5;
    word-break: break-word;
    text-align: left;
    box-sizing: border-box;
}

.tvc__bubble--plain { white-space: pre-wrap; }

/* User bubble — gray pill */
.tvc__bubble--user {
    background: var(--tvc-user-bubble-bg);
    color: var(--tvc-text);
}

/* Assistant bubble — no background, full width (ChatGPT style) */
.tvc__bubble--assistant {
    background: transparent;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Markdown */
.tvc__bubble--md p            { margin: 0 0 0.75rem; }
.tvc__bubble--md p:last-of-type { margin-bottom: 0; }
.tvc__bubble--md ul,
.tvc__bubble--md ol           { margin: 0.5rem 0 1rem; padding-left: 1.25rem; }
.tvc__bubble--md li           { margin-bottom: 0.25rem; }
.tvc__bubble--md h1,
.tvc__bubble--md h2,
.tvc__bubble--md h3           { margin: 0.5rem 0; font-size: 1em; font-weight: 700; }
.tvc__bubble--md code         { background: rgba(0,0,0,.07); border-radius: 3px; padding: 1px 4px; font-family: monospace; font-size: .9em; }
.tvc__bubble--md pre          { background: rgba(0,0,0,.07); border-radius: 6px; padding: 8px 10px; overflow-x: auto; margin: 4px 0; }
.tvc__bubble--md pre code     { background: none; padding: 0; }
.tvc__bubble--md strong       { font-weight: 700; }
.tvc__bubble--md em           { font-style: italic; }
.tvc__bubble--md a            { color: inherit; text-decoration: underline; }
.tvc__bubble--md table        { border-collapse: collapse; font-size: .875em; width: 100%; margin: 0.5em 0; }
.tvc__bubble--md th,
.tvc__bubble--md td           { border: 1px solid var(--tvc-border); padding: 5px 10px; text-align: left; }
.tvc__bubble--md th           { background: var(--tvc-assistant-bubble-bg); font-weight: 600; }

/* ── Chat input area ──────────────────────────────────────────────────────── */
.tvc__input-area {
    background: var(--tvc-bg);
}

/* Fixed input when chat is active */
.tvc--chat-active .tvc__input-area {
    position: fixed;
    bottom: 0;
    z-index: 100;
    background: var(--tvc-bg);
}

/* Chat form: relative container so send button can be absolute (mirrors hero) */
.tvc__form {
    position: relative;
    width: 100%;
}

.tvc__input {
    width: 100%;
    box-sizing: border-box;
    height: 3.5rem;
    padding: 0 3.25rem 0 1.125rem;
    border: 1px solid var(--tvc-border);
    border-radius: 1.875rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--tvc-text);
    background: var(--tvc-input-bg);
    outline: none;
    transition: border-color .15s;
}
.tvc__input:focus {
    border-color: var(--tvc-text-placeholder);
    background: var(--tvc-bg);
}

/* Chat send button — dark circle, absolutely positioned inside the input */
.tvc__send {
    position: absolute;
    right: 0.5rem;
    top: 1.75rem; /* half the input height, as for the first-screen send button */
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background: var(--tvc-send-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .15s;
    padding: 0;
    flex-shrink: 0;
}
.tvc__send:hover:not(:disabled) { opacity: .85; }
.tvc__send:disabled { opacity: .45; cursor: default; }
.tvc__send svg { width: 1.125rem; height: 1.125rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.tvc__footer {
    font-size: .9375rem;
    line-height: 1.5;
    text-align: left;
    padding: 20px 0;
}
.tvc__footer a {  text-decoration: underline; }

/* ── Action bar (Raw LLM Response etc.) ──────────────────────────────────── */
.tvc__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.tvc__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3125rem;
    min-width: 1.875rem;
    height: 1.875rem;
    padding: 0 0.5rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--tvc-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background .15s, color .15s;
}

/* Instant tooltip on the answer's action buttons (data-tip), instead of the slow native title. */
.tvc__action[data-tip] { position: relative; }
.tvc__action[data-tip]::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 6px); left: 50%; z-index: 20;
    transform: translate(-50%, 3px);
    padding: .25rem .5rem; border-radius: .375rem;
    background: #1f2329; color: #fff;
    font-size: .75rem; font-weight: 500; line-height: 1.4; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
}
.tvc__action[data-tip]:hover::after,
.tvc__action[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
/* The first button sits at the bubble's edge, so its tooltip opens to the right. */
.tvc__actions > .tvc__action[data-tip]:first-child::after { left: 0; transform: translate(0, 3px); }
.tvc__actions > .tvc__action[data-tip]:first-child:hover::after,
.tvc__actions > .tvc__action[data-tip]:first-child:focus-visible::after { transform: none; }
@media (prefers-reduced-motion: reduce) { .tvc__action[data-tip]::after { transition: none; } }
.tvc__action:hover { background: var(--tvc-assistant-bubble-bg); color: var(--tvc-text); }
.tvc__action svg { width: 1.0625rem; height: 1.0625rem; fill: currentColor; }
.tvc__action.is-active { color: var(--tvc-send-bg); }
.tvc__action--copied { color: #1a7f5a; }

.tvc__action--loading { cursor: default; color: var(--tvc-text-subtle); }
.tvc__action-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0,0,0,.15);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: tvc-spin .7s linear infinite;
    display: inline-block;
}
@keyframes tvc-spin { to { transform: rotate(360deg); } }

/* ── Expandable panel ────────────────────────────────────────────────────── */
.tvc__panel {
    margin-top: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background: #f1f2f5;
    font-size: 0.8125rem;
    line-height: 1.5;
}
.tvc__panel[hidden] { display: none; }

.tvc__panel-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.tvc__panel-title svg { width: 1.0625rem; height: 1.0625rem; fill: currentColor; flex-shrink: 0; }

/* Grounding: green when well supported by the agent's documents, red when weakly */
.tvc__action--grounding.is-high { color: #1a7f5a; }
.tvc__action--grounding.is-low  { color: #c0392b; }
.tvc__panel-title.is-high { color: #1a7f5a; }
.tvc__panel-title.is-low  { color: #c0392b; }
.tvc__panel-score { margin-left: auto; padding: 0.0625rem 0.5rem; border-radius: 1rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: .02em; background: rgba(0,0,0,.05); color: var(--tvc-text-muted); }
.tvc__panel-title.is-high .tvc__panel-score { background: rgba(26,127,90,.12); color: #1a7f5a; }
.tvc__panel-title.is-low  .tvc__panel-score { background: rgba(192,57,43,.12); color: #c0392b; }

.tvc__panel-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.5rem 0 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: #fff;
    color: var(--tvc-text-muted);
    font-size: 0.75rem;
    line-height: 1.45;
}
.tvc__panel-note svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.0625rem; fill: currentColor; }

.tvc__panel-body {
    color: var(--tvc-text);
    opacity: 0.85;
    white-space: pre-wrap;
    word-break: break-word;
}
.tvc__panel-body p { margin: 0 0 0.5rem; }
.tvc__panel-body p:last-child { margin-bottom: 0; }


/* ── Send button spinner ─────────────────────────────────────────────────── */
.tvc__spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tvc-spin .7s linear infinite;
}
@keyframes tvc-spin {
    to { transform: rotate(360deg); }
}

/* ── V5: stop, feedback, follow-ups ─────────────────────────────────────── */

/* Send button becomes a Stop button while an answer streams */
.tvc__send--stop { opacity: 1; }
.tvc__send--stop:disabled { opacity: .45; }
.tvc__stop-icon { display: inline-flex; align-items: center; justify-content: center; }
.tvc__stop-icon[hidden] { display: none; }

/* Thumbs up / down */
.tvc__action--feedback:disabled { opacity: .35; cursor: default; background: none; }
.tvc__action--feedback-up.is-selected   { color: #1a7f5a; background: rgba(26,127,90,.12); }
.tvc__action--feedback-down.is-selected { color: #c0392b; background: rgba(192,57,43,.12); }
.tvc__action--feedback.is-saving { animation: tvcFeedbackPulse 1.2s ease-in-out infinite; }
@keyframes tvcFeedbackPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .tvc__action--feedback.is-saving { animation: none; opacity: .6; } }
/* Pop on the thumb that was just chosen (on the icon, so it can run alongside the saving pulse) */
.tvc__action--feedback.is-popping svg { animation: tvcThumbPop .32s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes tvcThumbPop { 0% { transform: scale(1); } 45% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Confirmation badge next to the thumbs */
.tvc__feedback-status { display: none; align-items: center; gap: .3rem; margin-left: .5rem; padding: .2rem .625rem .2rem .45rem; border-radius: 999px; font-size: .75rem; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.tvc__feedback-status svg { width: .875rem; height: .875rem; fill: currentColor; flex-shrink: 0; }
.tvc__feedback-status.is-visible { display: inline-flex; animation: tvcBadgeIn .22s ease-out; }
.tvc__feedback-status.is-leaving { opacity: 0; transform: translateX(-4px); transition: opacity .25s, transform .25s; }
.tvc__feedback-status.is-positive { color: #1a7f5a; background: rgba(26, 127, 90, .1); }
.tvc__feedback-status.is-neutral  { color: var(--tvc-text-muted); background: rgba(0, 0, 0, .05); }
.tvc__feedback-status.is-error    { color: #c0392b; background: rgba(192, 57, 43, .1); }
@keyframes tvcBadgeIn { from { opacity: 0; transform: translateX(-6px) scale(.96); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .tvc__feedback-status.is-visible, .tvc__action--feedback.is-popping svg { animation: none; }
    .tvc__feedback-status.is-leaving { transition: none; }
}

/* Form guide: confirm button on the completing answer, and the badge it turns into */
.tvc__step-badge { display: inline-flex; align-items: center; padding: .125rem .625rem; border: 1px solid var(--tvc-border); border-radius: 1rem; font-size: .6875rem; font-weight: 500; color: var(--tvc-text-muted); white-space: nowrap; }
.tvc__confirmed-badge { border-color: #1a7f5a; color: #1a7f5a; }
.tvc__confirm-btn { display: inline-flex; align-items: center; margin-left: .25rem; padding: .25rem .875rem; border: none; border-radius: 1rem; font-size: .8125rem; font-weight: 600; background: #f59e0b; color: #fff; cursor: pointer; transition: background .15s; white-space: nowrap; }
.tvc__confirm-btn:hover:not(:disabled) { background: #d97706; }
.tvc__confirm-btn:disabled { opacity: .6; cursor: default; }
.tvc__confirm-btn.is-sending { opacity: 1; animation: tvcFeedbackPulse 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .tvc__confirm-btn.is-sending { animation: none; opacity: .6; } }


/* AI disclosure under the chat input — stays visible for the whole chat */
/* AI disclosure under the input. Uses the theme's main text colour so it reads clearly, and keeps
   clear of the screen edge while the input is fixed to the bottom (plus the phone's home bar). */
.tvc__ai-disclosure {
    margin: .5rem 0 0;
    padding-bottom: max(.875rem, env(safe-area-inset-bottom, 0px));
    font-size: .8125rem; font-weight: 500; line-height: 1.5; text-align: center;
    color: var(--tvc-text);
}

/* "Response stopped." under a partial answer */
.tvc__stopped-note { margin-top: .5rem; font-size: .8125rem; font-style: italic; color: var(--tvc-text-muted); }

/* Stopped before any answer arrived: a quiet system note rather than an answer bubble */
.tvc__msg--note { display: flex; }
.tvc__stopped-note--standalone { display: inline-flex; align-items: center; gap: .375rem; margin: .25rem 0 .75rem; }
.tvc__stopped-note--standalone svg { width: .625rem; height: .625rem; opacity: .7; }

/* Answer replaced by a correction (PII filter, guardrail, ungrounded answer) */
.tvc__bubble.tvc__bubble--corrected { display: flex; flex-direction: row; align-items: flex-start; flex-wrap: wrap; gap: .5rem; padding: .75rem .875rem; background: #fff8e1; border: 1px solid #f3d27a; border-radius: .75rem; color: var(--tvc-text); }
.tvc__bubble--corrected > span:not(.tvc__corrected-icon) { flex: 1 1 0; min-width: 0; }
.tvc__bubble--corrected > div { flex-basis: 100%; }
.tvc__corrected-icon { display: inline-flex; flex-shrink: 0; margin-top: .125rem; color: #b7791f; }
.tvc__corrected-icon svg { width: 1.125rem; height: 1.125rem; fill: currentColor; }

/* Follow-up question chips under the answer */
.tvc__followups { justify-content: flex-start; margin: .5rem 0 1rem; }
.tvc__chip--followup { text-align: left; }


/* Form guide choice card (Split steps), as in the portal. Theme colours via the widget's variables. */
.tvc__msg--choice { display: block; }
.tvc__choice { flex-shrink: 0; margin: .25rem 0 1rem; border: 1px solid var(--tvc-border); border-radius: .75rem; background: var(--tvc-bg); overflow: hidden; color: var(--tvc-text); }
.tvc__choice-q { padding: .875rem 1.125rem; border-bottom: 1px solid var(--tvc-border); font-weight: 600; }
.tvc__choice-opt { display: block; width: 100%; padding: .75rem 1.125rem; border: none; border-bottom: 1px solid var(--tvc-border); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tvc__choice-opt:hover, .tvc__choice-opt:focus-visible { background: var(--tvc-assistant-bubble-bg); outline: none; }
.tvc__choice-opt:disabled { cursor: default; opacity: .6; }
.tvc__choice-desc { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--tvc-text-muted); }
.tvc__choice-other { display: flex; gap: .5rem; padding: .625rem .5rem .625rem 1.125rem; }
.tvc__choice-other input { flex: 1; min-width: 0; padding: .5rem .75rem; border: 1px solid var(--tvc-border); border-radius: .25rem; background: var(--tvc-input-bg); color: var(--tvc-text); font: inherit; }
.tvc__choice-other input:focus { outline: none; border-color: var(--tvc-text); }
.tvc__choice-other input::placeholder { color: var(--tvc-text-placeholder); opacity: 1; }
.tvc__choice-other button { padding: .375rem 1rem; border: none; border-radius: .25rem; background: var(--tvc-send-bg); color: #fff; font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
.tvc__choice-other button:disabled { opacity: .35; cursor: default; }
.tvc__newform-note { margin: 0 0 1rem; font-size: .875rem; color: var(--tvc-text); }
.tvc__newform-note button { padding: 0; border: none; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* The send icon sits in a span: lay it out as a box, not a line of text, so it stays centred */
.tvc__send > span { display: inline-flex; align-items: center; justify-content: center; }
.tvc__send > span[hidden] { display: none; }

/* A question the PII filter refused: amber, with the redacted copy, as in the portal */
.tvc__msg--user .tvc__bubble.tvc__bubble--pii { background: rgba(240,165,0,.16); border: 1px solid #f0a500; color: var(--tvc-text); }
.tvc__pii-icon { display: inline-flex; vertical-align: middle; margin-right: .25rem; color: #f0a500; }
.tvc__pii-icon svg { width: 1.125rem; height: 1.125rem; }

/* ── Model menu (portal style): a quiet text button under the input that opens a list ── */
/* Model menu inside the input, left of the mic and send buttons (as a chat app shows the model that
   answers: "GPT-4o ▾"); the list opens below, aligned to the right. */
.tvc__model-picker { position: absolute; right: 3.5rem; top: 1.75rem; transform: translateY(-50%); z-index: 30; }
.tvc__form--has-mic .tvc__model-picker { right: 6.5rem; }
.tvc__form--has-model .tvc__input { padding-right: 15rem; }
.tvc__form--has-model.tvc__form--has-mic .tvc__input { padding-right: 18rem; }
.tvc__model-btn { display: inline-flex; align-items: center; gap: .125rem; max-width: 11rem; padding: .3125rem .375rem .3125rem .75rem; border: none; border-radius: 1rem; background: rgba(0,0,0,.05); color: var(--tvc-text); font: inherit; font-size: .8125rem; font-weight: 500; line-height: 1.2; cursor: pointer; transition: background .15s; } /* a control, not text: reads apart from the placeholder */
.tvc__model-btn > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvc__model-btn:hover { background: rgba(0,0,0,.09); }
.tvc__model-btn:focus-visible { outline: 2px solid var(--tvc-send-bg); outline-offset: 1px; }
.tvc__model-btn svg { width: 1.125rem; height: 1.125rem; fill: currentColor; flex-shrink: 0; }
.tvc__model-btn .tvc__model-icon { display: none; }
.tvc__model-btn .tvc__model-arrow { width: 1.25rem; height: 1.25rem; }
@media (max-width: 600px) {    .tvc__model-btn { max-width: 6.5rem; }    .tvc__form--has-model .tvc__input { padding-right: 10.5rem; }    .tvc__form--has-model.tvc__form--has-mic .tvc__input { padding-right: 13.5rem; }}
.tvc__model-menu { position: absolute; right: 0; top: calc(100% + .25rem); min-width: 15rem; max-height: 21rem; overflow-y: auto; padding: .25rem 0; background: var(--tvc-bg); border: 1px solid var(--tvc-border); border-radius: .5rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.tvc__model-menu[hidden] { display: none; }
.tvc__model-menu.is-up { top: auto; bottom: calc(100% + .25rem); }
.tvc__model-item { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .5rem .75rem; border: none; background: none; color: var(--tvc-text); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; }
.tvc__model-item:hover, .tvc__model-item:focus-visible { background: var(--tvc-assistant-bubble-bg); outline: none; }
.tvc__model-item svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; fill: currentColor; }
.tvc__model-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvc__model-check { margin-left: auto; visibility: hidden; }
.tvc__model-item[aria-checked="true"] .tvc__model-check { visibility: visible; }
.tvc__model-divider { height: 1px; margin: .25rem 0; background: var(--tvc-border); }

/* ── Mic: inside the input, left of the send button ── */
.tvc__mic { position: absolute; right: 3.5rem; top: 1.75rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; padding: 0; border: none; border-radius: 50%; background: none; color: var(--tvc-text); cursor: pointer; transition: background .15s; }
.tvc__mic[hidden] { display: none; }
.tvc__mic:hover { background: var(--tvc-assistant-bubble-bg); }
.tvc__mic svg { width: 1.25rem; height: 1.25rem; }
.tvc__mic.is-listening { color: #c0392b; }
.tvc__form--has-mic .tvc__input { padding-right: 6.5rem; }
.tvc__autosend { position: absolute; left: 1.5rem; right: 1.5rem; bottom: .25rem; height: 3px; border-radius: 2px; background: var(--tvc-send-bg); transform-origin: left; pointer-events: none; animation: tvcAutoSend 2s linear forwards; }
.tvc__autosend[hidden] { display: none; }
@keyframes tvcAutoSend { from { transform: scaleX(0); } to { transform: scaleX(1); } }


/* Raw LLM response: markdown keeps its own line breaks */
.tvc__raw-text.is-md { white-space: normal; }

/* ── Referenced documents under an answer ── */
.tvc__panel--refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem; }
.tvc__ref { display: flex; align-items: center; gap: .625rem; min-width: 0; padding: .5rem .75rem; border: 1px solid var(--tvc-border); border-radius: .5rem; background: var(--tvc-bg); color: var(--tvc-text); font: inherit; font-size: .8125rem; text-align: left; }
.tvc__ref svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; fill: currentColor; }
.tvc__ref-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
button.tvc__ref { cursor: pointer; }
button.tvc__ref:hover { background: var(--tvc-assistant-bubble-bg); }
button.tvc__ref:disabled { opacity: .6; cursor: progress; }
.tvc__ref-dl { margin-left: auto; color: var(--tvc-text-muted); }
.tvc__action--speaking { color: #c0392b; }

/* ── Working indicator (spinning star + status) in the widget's own colours ── */
.tvc__indicator { display: flex; align-items: center; gap: .5rem; padding: .375rem .125rem; }
.tvc__indicator-icon { display: inline-flex; width: 1.125rem; height: 1.125rem; flex-shrink: 0; color: var(--tvc-send-bg); animation: tvcIndicatorSpin 2s ease-in-out infinite; }
.tvc__indicator-icon svg { width: 100%; height: 100%; }
.tvc__indicator-status { font-size: .8125rem; font-weight: 500; color: var(--tvc-text-muted); }
@keyframes tvcIndicatorSpin { 0% { transform: rotate(0); } 75%, 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tvc__indicator-icon { animation: none; } }

/* ── Export: beside the New chat button ── */
.tvc__export[hidden] { display: none; }
.tvc--chat-active .tvc__export { position: absolute; top: -6rem; right: 3rem; z-index: 10; }



/* Rich-text info cards (from the backoffice editor): paragraphs and lists inside one card */
.tvc__disclaimer-body { flex: 1; min-width: 0; }
.tvc__disclaimer-body p { margin: 0 0 .5em; }
.tvc__disclaimer-body > :last-child { margin-bottom: 0; }
.tvc__disclaimer-body ul, .tvc__disclaimer-body ol { margin: 0 0 .5em; padding-left: 1.25rem; }
.tvc__disclaimer a { color: inherit; text-decoration: underline; }

/* Suggestions under an answer (when the agent has follow-ups on), each group with its own look so they
   read apart: question pills, small grey tags, topic links with a document icon. Each asks straight away. */
.tvc__suggestions { display: flex; flex-direction: column; gap: 1.125rem; margin: .75rem 0 1.25rem; }
.tvc__suggestions-group { display: flex; flex-direction: column; gap: .5rem; }
.tvc__suggestions-label { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tvc-text-subtle); }
.tvc__suggestions .tvc__followups { margin: 0; }
.tvc__suggestions .tvc__chip { white-space: normal; text-align: left; }
/* Tags: small grey labels */
.tvc__suggestions .tvc__chip--tag { gap: .3125rem; padding: .25rem .625rem; border: none; border-radius: .375rem; background: var(--tvc-assistant-bubble-bg); color: var(--tvc-text-muted); font-size: .75rem; }
.tvc__suggestions .tvc__chip--tag:hover { background: var(--tvc-border); color: var(--tvc-text); }
.tvc__chip--tag svg { width: .8125rem; height: .8125rem; fill: currentColor; flex-shrink: 0; }
/* Related topics: links to read more about, with a document icon */
.tvc__suggestions .tvc__followups:has(.tvc__chip--topic) { flex-direction: column; align-items: flex-start; gap: .25rem; }
.tvc__suggestions .tvc__chip--topic { gap: .5rem; padding: .125rem 0; border: none; border-radius: 0; background: none; color: var(--tvc-text); font-size: .875rem; font-weight: 500; }
.tvc__suggestions .tvc__chip--topic:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.tvc__chip--topic svg { width: 1rem; height: 1rem; fill: currentColor; flex-shrink: 0; color: var(--tvc-text-muted); }
