:root {
    --tmti-ca-blue: #2f63d9;
    --tmti-ca-blue-dark: #244ea8;
    --tmti-ca-dark: #192538;
    --tmti-ca-border: #d8e0ea;
    --tmti-ca-soft: #f7f9fc;
    --tmti-ca-green: #16803c;
}
.tmti-ca, .tmti-ca * { box-sizing: border-box; }
.tmti-ca {
    --tmti-ca-viewport-height: 100vh;
    --tmti-ca-viewport-width: 100vw;
    --tmti-ca-viewport-top: 0px;
    --tmti-ca-viewport-left: 0px;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
}
.tmti-ca-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    background: var(--tmti-ca-blue);
    color: #fff;
    font: inherit;
    font-weight: 750;
    box-shadow: 0 10px 28px rgba(26, 47, 87, .28);
    cursor: pointer;
}
.tmti-ca-bubble-icon { font-size: 20px; }
.tmti-ca.is-open .tmti-ca-bubble { display: none; }
.tmti-ca-panel {
    width: 540px;
    max-width: calc(100vw - 32px);
    height: min(720px, calc(100vh - 44px));
    max-height: min(720px, calc(100vh - 44px));
    background: #fff;
    border: 1px solid rgba(28, 42, 65, .12);
    border-radius: 17px;
    overflow: hidden;
    box-shadow: 0 18px 55px rgba(20, 34, 58, .25);
    display: flex;
    flex-direction: column;
}
.tmti-ca-panel[hidden] { display: none; }
.tmti-ca-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    background: var(--tmti-ca-dark);
    color: #fff;
}
.tmti-ca-header > div { min-width: 0; }
.tmti-ca-header strong, .tmti-ca-header span { display: block; }
.tmti-ca-header strong { font-size: 17px; line-height: 1.2; }
.tmti-ca-header span { opacity: .82; font-size: 12px; line-height: 1.35; margin-top: 3px; }
.tmti-ca-close {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.tmti-ca-messages {
    flex: 1 1 auto;
    min-height: 220px;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    background: var(--tmti-ca-soft);
}
.tmti-ca-message { display: flex; margin: 0 0 11px; }
.tmti-ca-message > div {
    max-width: 90%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.47;
    font-size: 14px;
    border-radius: 14px;
    padding: 10px 12px;
}
.tmti-ca-message-assistant { justify-content: flex-start; }
.tmti-ca-message-assistant > div { background: #fff; color: #172033; border: 1px solid var(--tmti-ca-border); }
.tmti-ca-message-visitor { justify-content: flex-end; }
.tmti-ca-message-visitor > div { background: var(--tmti-ca-blue); color: #fff; }
.tmti-ca-message.is-error > div { border-color: #f0a6a6; background: #fff4f4; color: #8b1a1a; }
.tmti-ca-message.is-thinking > div { display: inline-flex; align-items: center; gap: 5px; min-width: 44px; min-height: 20px; }
.tmti-ca-message.is-thinking > div > span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: tmti-ca-thinking-dot 1.15s infinite ease-in-out; }
.tmti-ca-message.is-thinking > div > span:nth-child(2) { animation-delay: .16s; }
.tmti-ca-message.is-thinking > div > span:nth-child(3) { animation-delay: .32s; }
@keyframes tmti-ca-thinking-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .3; } 30% { transform: translateY(-4px); opacity: .9; } }
.tmti-ca-workspace { flex: 0 1 auto; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; background: #fff; }
.tmti-ca-priority-form { padding: 13px 14px 8px; }
.tmti-ca-priority-options { display: grid; gap: 8px; }
.tmti-ca-priority-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c8d4e4;
    border-radius: 12px;
    background: #fff;
    color: #20324e;
    font-size: 14px;
    font-weight: 680;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.tmti-ca-priority-card:hover { border-color: #8eaae0; }
.tmti-ca-priority-card:has(input:checked) {
    border-color: var(--tmti-ca-blue);
    background: #eef4ff;
    box-shadow: 0 0 0 2px rgba(47, 99, 217, .10);
}
.tmti-ca-priority-card input { position: absolute; opacity: 0; pointer-events: none; }
.tmti-ca-priority-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border: 1px solid #9fb0c8;
    border-radius: 7px;
    background: #fff;
    color: transparent;
    font-size: 14px;
    font-weight: 900;
}
.tmti-ca-priority-card input:checked + .tmti-ca-priority-check {
    border-color: var(--tmti-ca-blue);
    background: var(--tmti-ca-blue);
    color: #fff;
}
.tmti-ca-other-wrap { margin-top: 10px; }
.tmti-ca-other-wrap label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 700; color: #35455d; }
.tmti-ca-other-wrap textarea {
    display: block;
    width: 100%;
    min-height: 76px;
    max-height: 130px;
    resize: none;
    overflow-y: auto;
    border: 1px solid #b8c3d1;
    border-radius: 10px;
    padding: 10px;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
}
.tmti-ca-character-count { margin-top: 4px; text-align: right; color: #687386; font-size: 10px; }
.tmti-ca-primary-button,
.tmti-ca-composer button,
.tmti-ca-followup button[type="submit"] {
    border: 0;
    border-radius: 10px;
    background: var(--tmti-ca-blue);
    color: #fff;
    font: inherit;
    font-weight: 760;
    cursor: pointer;
}
.tmti-ca-priority-form > .tmti-ca-primary-button { width: 100%; min-height: 44px; margin-top: 10px; padding: 10px 14px; }
.tmti-ca-selection-summary {
    margin: 10px 14px 0;
    padding: 10px 11px;
    border: 1px solid #d9e2ef;
    border-radius: 12px;
    background: #f8faff;
}
.tmti-ca-selection-summary > strong { display: block; margin-bottom: 7px; font-size: 12px; color: #45546c; }
.tmti-ca-selection-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tmti-ca-selection-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #c7d5e8;
    color: #28405f;
    font-size: 11px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.tmti-ca-selection-chip.is-answered { border-color: #8bc49d; background: #eef9f1; color: #195e31; }
.tmti-ca-other-preview {
    display: block;
    flex-basis: 100%;
    padding: 3px 2px 0;
    color: #657185;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.tmti-ca-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 11px 14px 4px;
    min-width: 0;
}
.tmti-ca-actions button, .tmti-ca-actions a {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    border: 1px solid #9db6db;
    background: #eef4ff;
    color: #23416c;
    border-radius: 999px;
    padding: 9px 12px;
    font: inherit;
    font-size: 12px;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
}
.tmti-ca-actions .tmti-ca-topic-button { flex: 1 1 45%; border-radius: 11px; text-align: left; background: #fff; }
.tmti-ca-actions .tmti-ca-join-button { background: var(--tmti-ca-blue); border-color: var(--tmti-ca-blue); color: #fff; font-weight: 760; }
.tmti-ca-actions .tmti-ca-more-button { background: #fff; }
.tmti-ca-human-button { background: #fff7e8 !important; border-color: #e6b95d !important; color: #744f08 !important; }
.tmti-ca-composer {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 11px 14px 7px;
}
.tmti-ca-composer textarea {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    resize: none;
    min-height: 46px;
    max-height: 100px;
    overflow-y: auto;
    border: 1px solid #b8c3d1;
    border-radius: 10px;
    padding: 10px;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
}
.tmti-ca-composer button { flex: 0 0 auto; padding: 9px 15px; }
.tmti-ca-secondary-actions {
    display: flex;
    justify-content: center;
    gap: 8px 16px;
    padding: 8px 14px 5px;
}
.tmti-ca-secondary-actions button,
.tmti-ca-keep-talking {
    border: 0;
    background: transparent;
    color: #526781;
    padding: 3px 0;
    font: inherit;
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.tmti-ca-followup {
    margin: 11px 14px 4px;
    padding: 12px;
    border: 1px solid #d6deea;
    border-radius: 12px;
    background: #fff;
    max-height: 385px;
    overflow-y: auto;
    overflow-x: hidden;
}
.tmti-ca-followup-title { margin: 0 0 4px; }
.tmti-ca-followup-notice { margin: 0 0 10px; color: #5d6b7c; font-size: 12px; }
.tmti-ca-followup label { display: block; font-size: 12px; font-weight: 680; margin-bottom: 8px; }
.tmti-ca-followup label span { font-weight: 400; color: #6b7280; }
.tmti-ca-followup input, .tmti-ca-followup textarea {
    display: block;
    width: 100%;
    min-width: 0;
    margin-top: 4px;
    padding: 9px;
    border: 1px solid #b8c3d1;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
}
.tmti-ca-followup textarea { resize: vertical; min-height: 76px; }
.tmti-ca-followup button[type="submit"] { width: 100%; min-height: 43px; padding: 9px 14px; }
.tmti-ca-keep-talking { display: block; margin: 8px auto 0; }
.tmti-ca-followup-status { white-space: pre-wrap; font-size: 12px; line-height: 1.4; margin: 8px 0 0; }
.tmti-ca-followup-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.tmti-ca-followup-result-actions button,
.tmti-ca-followup-result-actions a {
    flex: 1 1 145px;
    max-width: 100%;
    border: 1px solid #9db6db;
    background: #eef4ff;
    color: #23416c;
    border-radius: 10px;
    padding: 9px 11px;
    font: inherit;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
    cursor: pointer;
}
.tmti-ca-followup-result-actions .tmti-ca-join-button {
    background: var(--tmti-ca-blue);
    border-color: var(--tmti-ca-blue);
    color: #fff;
    font-weight: 760;
}
.tmti-ca-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; }
.tmti-ca-privacy { margin: 0; padding: 0 14px 11px; color: #687386; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.tmti-ca button:disabled { opacity: .55; cursor: wait; }

@media (max-width: 520px) {
    .tmti-ca { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); }
    .tmti-ca-bubble-label { display: block; }
    .tmti-ca-bubble { width: 52px; height: 52px; justify-content: center; padding: 0; }
    .tmti-ca-panel {
        position: fixed;
        left: calc(var(--tmti-ca-viewport-left) + max(8px, env(safe-area-inset-left)));
        right: auto;
        top: calc(var(--tmti-ca-viewport-top) + 8px);
        bottom: auto;
        width: calc(var(--tmti-ca-viewport-width) - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right)));
        max-width: none;
        min-width: 0;
        height: calc(var(--tmti-ca-viewport-height) - 16px);
        max-height: none;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 16px;
        contain: layout paint;
    }
    .tmti-ca-panel[hidden] { display: none; }
    .tmti-ca-header { flex: 0 0 auto; padding: 12px 13px; }
    .tmti-ca-header strong { font-size: 17px; }
    .tmti-ca-close { flex-basis: 44px; width: 44px; height: 44px; }
    .tmti-ca-messages { flex: 1 1 auto; min-height: 88px; max-height: none; padding: 12px; }
    .tmti-ca-message > div { max-width: 92%; font-size: 14px; }
    .tmti-ca-workspace { flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
    .tmti-ca-priority-form { padding: 10px 10px 5px; }
    .tmti-ca-priority-options { gap: 7px; }
    .tmti-ca-priority-card { min-height: 44px; padding: 9px 10px; font-size: 14px; }
    .tmti-ca-other-wrap textarea, .tmti-ca-composer textarea, .tmti-ca-followup input, .tmti-ca-followup textarea { font-size: 16px; }
    .tmti-ca-selection-summary { margin: 8px 10px 0; }
    .tmti-ca-actions { padding: 9px 10px 3px; }
    .tmti-ca-actions button, .tmti-ca-actions a { font-size: 13px; padding: 9px 11px; }
    .tmti-ca-actions .tmti-ca-topic-button { flex-basis: 100%; }
    .tmti-ca-composer {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        min-width: 0;
        padding: 9px 10px 5px;
    }
    .tmti-ca-composer textarea { width: 100%; min-width: 0; min-height: 50px; max-height: 90px; }
    .tmti-ca-composer button { width: 100%; min-height: 44px; padding: 10px 14px; font-size: 16px; }
    .tmti-ca-secondary-actions { padding: 7px 10px 4px; }
    .tmti-ca-secondary-actions button { font-size: 12px; }
    .tmti-ca-followup { margin: 8px 10px 4px; max-height: none; }
    .tmti-ca-privacy { padding: 0 10px max(9px, env(safe-area-inset-bottom)); font-size: 10px; }

    .tmti-ca.is-keyboard-open .tmti-ca-header span,
    .tmti-ca.is-keyboard-open .tmti-ca-selection-summary,
    .tmti-ca.is-keyboard-open .tmti-ca-secondary-actions,
    .tmti-ca.is-keyboard-open .tmti-ca-privacy { display: none !important; }
    .tmti-ca.is-keyboard-open .tmti-ca-header { padding-top: 8px; padding-bottom: 8px; }
    .tmti-ca.is-keyboard-open .tmti-ca-messages { min-height: 50px; padding: 8px 10px; }
    .tmti-ca.is-keyboard-open .tmti-ca-workspace { flex: 0 0 auto; }
    .tmti-ca.is-keyboard-open .tmti-ca-composer { padding: 6px 10px max(6px, env(safe-area-inset-bottom)); }

    .tmti-ca.is-followup-open .tmti-ca-selection-summary,
    .tmti-ca.is-followup-open .tmti-ca-actions,
    .tmti-ca.is-followup-open .tmti-ca-composer,
    .tmti-ca.is-followup-open .tmti-ca-secondary-actions,
    .tmti-ca.is-followup-open .tmti-ca-privacy { display: none !important; }
    .tmti-ca.is-followup-open .tmti-ca-messages { flex: 0 1 122px; min-height: 65px; max-height: 122px; }
    .tmti-ca.is-followup-open .tmti-ca-workspace { flex: 1 1 auto; overflow: hidden; }
    .tmti-ca.is-followup-open .tmti-ca-followup { display: block; height: calc(100% - 12px); overflow-y: auto; margin-bottom: max(8px, env(safe-area-inset-bottom)); }
}

@media (max-width: 920px) and (orientation: landscape) {
    .tmti-ca-panel {
        position: fixed;
        left: calc(var(--tmti-ca-viewport-left) + max(4px, env(safe-area-inset-left)));
        right: auto;
        top: calc(var(--tmti-ca-viewport-top) + 4px);
        bottom: auto;
        width: calc(var(--tmti-ca-viewport-width) - max(4px, env(safe-area-inset-left)) - max(4px, env(safe-area-inset-right)));
        max-width: none;
        min-width: 0;
        height: calc(var(--tmti-ca-viewport-height) - 8px);
        max-height: none;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(250px, 42%);
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
        border-radius: 10px;
    }
    .tmti-ca-panel[hidden] { display: none; }
    .tmti-ca-header { grid-column: 1 / -1; padding: 7px 10px; }
    .tmti-ca-header strong { font-size: 14px; }
    .tmti-ca-header span { font-size: 11px; }
    .tmti-ca-messages { min-height: 0; max-height: none; padding: 8px 10px; }
    .tmti-ca-workspace { min-height: 0; overflow-y: auto; border-left: 1px solid #e1e7ef; }
    .tmti-ca-priority-form { padding: 7px 8px; }
    .tmti-ca-priority-options { grid-template-columns: 1fr 1fr; gap: 5px; }
    .tmti-ca-priority-card { min-height: 38px; padding: 6px 8px; font-size: 12px; }
    .tmti-ca-selection-summary { margin: 6px 8px 0; }
    .tmti-ca-actions { padding: 6px 8px 2px; gap: 5px; }
    .tmti-ca-actions button, .tmti-ca-actions a { font-size: 11px; padding: 6px 8px; }
    .tmti-ca-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 6px 8px; }
    .tmti-ca-composer textarea { width: 100%; min-width: 0; min-height: 44px; max-height: 58px; font-size: 16px; }
    .tmti-ca-composer button { min-width: 72px; min-height: 44px; }
    .tmti-ca-secondary-actions { padding: 4px 8px; }
    .tmti-ca-followup { max-height: none; margin: 6px 8px; }
    .tmti-ca-followup input, .tmti-ca-followup textarea { font-size: 16px; }
    .tmti-ca-privacy { display: none; }
    .tmti-ca.is-keyboard-open .tmti-ca-selection-summary,
    .tmti-ca.is-keyboard-open .tmti-ca-secondary-actions { display: none !important; }
}

/* v0.3.1: keep action labels readable across theme hover overrides. */
.tmti-ca-actions button:hover,
.tmti-ca-actions button:focus-visible,
.tmti-ca-actions a:hover,
.tmti-ca-actions a:focus-visible {
    color: #23416c !important;
    background: #e4edfc;
}
.tmti-ca-actions .tmti-ca-join-button:hover,
.tmti-ca-actions .tmti-ca-join-button:focus-visible {
    color: #fff !important;
    background: var(--tmti-ca-blue);
}
.tmti-ca-actions .tmti-ca-human-button:hover,
.tmti-ca-actions .tmti-ca-human-button:focus-visible {
    color: #744f08 !important;
    background: #fff1d5 !important;
}

/* v0.4.0 guided creator interview and streamlined action design. */
.tmti-ca-actions.is-topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.tmti-ca-actions.is-topic-grid .tmti-ca-topic-button {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    border: 1px solid #9db5da;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7fd 100%);
    color: #1e3d6b;
    font-weight: 720;
    box-shadow: 0 2px 5px rgba(33, 65, 110, .10);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.tmti-ca-actions.is-topic-grid .tmti-ca-topic-button:hover,
.tmti-ca-actions.is-topic-grid .tmti-ca-topic-button:focus-visible {
    transform: translateY(-1px);
    border-color: var(--tmti-ca-blue);
    background: #edf3ff;
    box-shadow: 0 5px 12px rgba(33, 65, 110, .16);
    color: #183968 !important;
}
.tmti-ca-actions.is-topic-grid .tmti-ca-topic-button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 5px);
    justify-self: center;
}
.tmti-ca-actions .tmti-ca-primary-action {
    background: var(--tmti-ca-blue);
    border-color: var(--tmti-ca-blue);
    color: #fff;
    font-weight: 760;
}
.tmti-ca-actions .tmti-ca-primary-action:hover,
.tmti-ca-actions .tmti-ca-primary-action:focus-visible {
    background: var(--tmti-ca-blue-dark) !important;
    color: #fff !important;
}
.tmti-ca-actions .tmti-ca-secondary-action {
    background: #fff;
    border-color: #a9bad3;
    color: #29496f;
}
.tmti-ca-actions.is-human-choice,
.tmti-ca-actions.is-readiness-grid {
    display: grid;
    grid-template-columns: 1fr;
}
.tmti-ca-actions.is-human-choice button,
.tmti-ca-actions.is-readiness-grid button {
    width: 100%;
    min-height: 44px;
    border-radius: 11px;
    text-align: center;
    justify-content: center;
}
.tmti-ca button:focus-visible,
.tmti-ca a:focus-visible,
.tmti-ca textarea:focus-visible,
.tmti-ca input:focus-visible {
    outline: 3px solid rgba(47, 99, 217, .28);
    outline-offset: 2px;
}

/* Human contact is a dedicated screen, not a nested scrolling card. */
.tmti-ca.is-followup-open .tmti-ca-messages,
.tmti-ca.is-followup-open .tmti-ca-secondary-actions,
.tmti-ca.is-followup-open .tmti-ca-privacy {
    display: none !important;
}
.tmti-ca.is-followup-open .tmti-ca-workspace {
    flex: 1 1 auto;
    overflow: visible;
}
.tmti-ca-followup {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 10px;
    margin: 0;
    padding: 16px;
    border: 0;
    border-radius: 0;
    max-height: none;
    overflow: visible;
}
.tmti-ca-followup[hidden] { display: none; }
.tmti-ca-followup-title,
.tmti-ca-followup-notice,
.tmti-ca-followup label:has(textarea),
.tmti-ca-followup label:nth-of-type(3),
.tmti-ca-followup button[type="submit"],
.tmti-ca-followup .tmti-ca-keep-talking,
.tmti-ca-followup-status,
.tmti-ca-followup-result-actions,
.tmti-ca-honeypot {
    grid-column: 1 / -1;
}
.tmti-ca-followup-title { font-size: 18px; margin: 0; }
.tmti-ca-followup-notice { margin: -5px 0 2px; }
.tmti-ca-followup label { margin: 0; }
.tmti-ca-followup input,
.tmti-ca-followup textarea { margin-top: 5px; }
.tmti-ca-followup textarea { min-height: 88px; max-height: 120px; resize: vertical; }
.tmti-ca-followup button[type="submit"] { margin-top: 2px; }
.tmti-ca-followup .tmti-ca-keep-talking { margin: 0 auto; }


@media (max-width: 520px) {
    .tmti-ca-panel {
        width: min(390px, calc(100vw - 20px));
        height: min(680px, calc(var(--tmti-ca-viewport-height) - 20px));
        max-height: calc(var(--tmti-ca-viewport-height) - 20px);
    }
    .tmti-ca-actions.is-topic-grid { grid-template-columns: 1fr; }
    .tmti-ca-actions.is-topic-grid .tmti-ca-topic-button:last-child:nth-child(odd) {
        grid-column: auto;
        width: 100%;
    }
    .tmti-ca-followup { grid-template-columns: 1fr; padding: 13px; overflow-y: auto; }
    .tmti-ca-followup > * { grid-column: 1 !important; }
    .tmti-ca.is-followup-open .tmti-ca-workspace { overflow: hidden; }
    .tmti-ca.is-followup-open .tmti-ca-followup { height: 100%; overflow-y: auto; margin: 0; }
}


/* v0.4.6: keep the complete desktop panel inside the visual viewport. */
@media (min-width: 521px) and (min-height: 521px) {
    .tmti-ca-panel {
        position: fixed;
        top: calc(var(--tmti-ca-viewport-top) + 16px);
        right: 16px;
        bottom: auto;
        width: min(540px, calc(var(--tmti-ca-viewport-width) - 32px));
        height: min(720px, calc(var(--tmti-ca-viewport-height) - 32px));
        max-height: calc(var(--tmti-ca-viewport-height) - 32px);
        min-height: 0;
    }
    .tmti-ca-header { flex: 0 0 auto; }
    .tmti-ca-messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }
    .tmti-ca-workspace {
        flex: 0 0 auto;
        min-height: 0;
        max-height: min(46%, 330px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
    .tmti-ca-actions,
    .tmti-ca-composer,
    .tmti-ca-secondary-actions,
    .tmti-ca-privacy {
        flex-shrink: 0;
    }
}

/* v0.4.7: compact, keyboard-safe mobile composer. */
@media (max-width: 520px) {
    .tmti-ca-composer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 7px;
        padding: 8px 10px max(7px, env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid #e1e7ef;
    }
    .tmti-ca-composer textarea {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        max-height: 88px;
        padding: 11px 12px;
        border-radius: 12px;
        line-height: 1.3;
    }
    .tmti-ca-composer button {
        width: auto;
        min-width: 72px;
        min-height: 46px;
        padding: 10px 14px;
        border-radius: 12px;
        white-space: nowrap;
        align-self: end;
    }
    .tmti-ca.is-keyboard-open .tmti-ca-panel {
        top: calc(var(--tmti-ca-viewport-top) + 4px);
        height: calc(var(--tmti-ca-viewport-height) - 8px);
        border-radius: 12px;
    }
    .tmti-ca.is-keyboard-open .tmti-ca-header {
        padding: 7px 10px;
    }
    .tmti-ca.is-keyboard-open .tmti-ca-header strong {
        font-size: 15px;
    }
    .tmti-ca.is-keyboard-open .tmti-ca-messages {
        flex: 1 1 auto;
        min-height: 0;
        padding: 8px 10px;
        scroll-padding-bottom: 12px;
    }
    .tmti-ca.is-keyboard-open .tmti-ca-workspace {
        flex: 0 0 auto;
        min-height: 0;
        overflow: visible;
    }
    .tmti-ca.is-keyboard-open .tmti-ca-actions,
    .tmti-ca.is-keyboard-open .tmti-ca-selection-summary,
    .tmti-ca.is-keyboard-open .tmti-ca-secondary-actions,
    .tmti-ca.is-keyboard-open .tmti-ca-privacy {
        display: none !important;
    }
    .tmti-ca.is-keyboard-open .tmti-ca-composer {
        padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    }
}

/* v0.5.0 consultation experience */
.tmti-ca { right: 24px; top: 145px; bottom: auto; }
.tmti-ca-bubble {
    min-width: 250px; min-height: 48px; justify-content: flex-start;
    padding: 8px 12px; border-radius: 15px; background: var(--tmti-ca-dark);
    box-shadow: 0 12px 34px rgba(20,34,58,.20);
}
.tmti-ca-avatar {
    display:inline-flex; align-items:center; justify-content:center; flex:0 0 28px;
    width:28px; height:28px; border-radius:50%; background:var(--tmti-ca-blue); color:#fff;
    font-size:12px; font-weight:800;
}
.tmti-ca-bubble-label { flex:1; text-align:left; font-size:13px; }
.tmti-ca-bubble-chevron { margin-left:auto; opacity:.8; }
.tmti-ca-panel {
    width: 380px; max-width: calc(100vw - 32px); height: min(620px, calc(100vh - 175px));
    max-height: min(620px, calc(100vh - 175px)); border-radius: 16px;
    border-color:#c9d5e5; box-shadow:0 18px 50px rgba(20,34,58,.18);
}
.tmti-ca-header { position:relative; justify-content:flex-start; padding:11px 12px; background:var(--tmti-ca-dark); }
.tmti-ca-header-copy { flex:1; min-width:0; }
.tmti-ca-header strong { font-size:14px; }
.tmti-ca-header span { font-size:11px; margin-top:0; }
.tmti-ca-close { flex:0 0 30px; width:30px; height:30px; font-size:20px; }
.tmti-ca-menu-toggle { display:block; margin-left:auto; border:0; background:transparent; color:#fff; font-size:22px; cursor:pointer; }
.tmti-ca-header-menu { position:absolute; z-index:10; right:10px; top:50px; min-width:160px; padding:6px; border:1px solid #d7e0eb; border-radius:10px; background:#fff; box-shadow:0 10px 30px rgba(20,34,58,.18); }
.tmti-ca-header-menu[hidden] { display:none; }
.tmti-ca-header-menu button { display:block; width:100%; border:0; border-radius:7px; padding:9px 10px; background:#fff; color:#20324e; text-align:left; cursor:pointer; }
.tmti-ca-header-menu button:hover { background:#f1f5fb; }
.tmti-ca-messages { padding:12px; background:#f7f9fc; }
.tmti-ca-message > div { max-width:92%; padding:9px 11px; border-radius:11px; font-size:13px; line-height:1.42; }
.tmti-ca-workspace { border-top:1px solid #e2e8f0; }
.tmti-ca-priority-form { padding:10px; }
.tmti-ca-priority-options { gap:5px; }
.tmti-ca-priority-card { min-height:36px; padding:7px 9px; border-radius:8px; font-size:12px; font-weight:560; }
.tmti-ca-priority-check { flex-basis:16px; width:16px; height:16px; border-radius:5px; font-size:10px; }
.tmti-ca-priority-form > .tmti-ca-primary-button { min-height:38px; margin-top:8px; border-radius:8px; }
.tmti-ca-selection-summary { display:none !important; }
.tmti-ca-actions { padding:8px 10px 2px; }
.tmti-ca-composer { padding:8px 10px; align-items:center; }
.tmti-ca-composer textarea { min-height:38px; max-height:82px; border-radius:18px; padding:8px 12px; font-size:12px; }
.tmti-ca-composer button { width:34px; height:34px; padding:0; border-radius:50%; font-size:0; }
.tmti-ca-composer button::after { content:'→'; font-size:18px; line-height:1; }
.tmti-ca-secondary-actions { display:none; }
.tmti-ca-privacy { display:none; }

@media (min-width: 783px) {
    .tmti-ca-panel:not([hidden]) { display:flex; }
}

@media (max-width: 782px) {
    .tmti-ca {
        top:auto; right:12px; left:12px; bottom:calc(12px + env(safe-area-inset-bottom));
        width:auto;
    }
    .tmti-ca-bubble { width:100%; min-width:0; border-radius:24px; min-height:52px; }
    .tmti-ca-panel {
        position:fixed; left:max(10px, var(--tmti-ca-viewport-left));
        right:max(10px, calc(100vw - var(--tmti-ca-viewport-left) - var(--tmti-ca-viewport-width)));
        top:calc(var(--tmti-ca-viewport-top) + 10px);
        bottom:calc(100vh - var(--tmti-ca-viewport-top) - var(--tmti-ca-viewport-height) + 10px);
        width:auto; max-width:none; height:auto; max-height:none; border-radius:22px;
    }
    .tmti-ca-header { background:#fff; color:#1c2b43; border-bottom:1px solid #e2e8f0; padding:12px 14px; }
    .tmti-ca-header strong { font-size:15px; }
    .tmti-ca-header span { color:#728098; opacity:1; }
    .tmti-ca-close { color:#607089; order:5; }
    .tmti-ca-menu-toggle { display:block; color:#607089; margin-left:auto; }
    .tmti-ca-header-menu { top:58px; right:12px; }
    .tmti-ca-messages { min-height:0; padding:12px; }
    .tmti-ca-workspace { flex:0 0 auto; overflow:visible; }
    .tmti-ca-composer { padding:8px 10px calc(8px + env(safe-area-inset-bottom)); background:#fff; }
    .tmti-ca-composer textarea { font-size:16px; }
    .tmti-ca-followup { max-height:none; }
    .tmti-ca.is-keyboard-open .tmti-ca-panel { top:calc(var(--tmti-ca-viewport-top) + 4px); bottom:4px; border-radius:16px; }
    .tmti-ca.is-keyboard-open .tmti-ca-header { padding-top:8px; padding-bottom:8px; }
}


/* v0.5.1 desktop gutter panel + mobile contrast repair */
@media (min-width: 783px) {
    .tmti-ca {
        position: fixed;
        top: 132px;
        right: clamp(22px, 3.2vw, 64px);
        bottom: auto;
        left: auto;
        width: 410px;
        z-index: 999999;
    }

    .tmti-ca-panel {
        width: 410px;
        max-width: calc(100vw - 44px);
        height: min(660px, calc(100vh - 154px));
        max-height: min(660px, calc(100vh - 154px));
        border-radius: 18px;
        background: #ffffff;
        box-shadow: 0 20px 58px rgba(17, 32, 57, .22);
    }

    .tmti-ca-bubble {
        width: 410px;
    }

    .tmti-ca-header {
        min-height: 64px;
        padding: 13px 15px;
        background: #192538;
        color: #ffffff;
    }

    .tmti-ca-messages {
        background: #f7f9fc;
    }
}

@media (max-width: 782px) {
    .tmti-ca,
    .tmti-ca-panel,
    .tmti-ca-workspace,
    .tmti-ca-messages,
    .tmti-ca-priority-form,
    .tmti-ca-followup,
    .tmti-ca-composer {
        color: #172033;
    }

    .tmti-ca-panel,
    .tmti-ca-workspace,
    .tmti-ca-priority-form,
    .tmti-ca-followup,
    .tmti-ca-composer,
    .tmti-ca-header-menu {
        background: #ffffff;
    }

    .tmti-ca-priority-card,
    .tmti-ca-priority-card span,
    .tmti-ca-followup label,
    .tmti-ca-followup p,
    .tmti-ca-other-wrap label,
    .tmti-ca-secondary-actions button,
    .tmti-ca-header-menu button {
        color: #20324e !important;
    }

    .tmti-ca-priority-card,
    .tmti-ca-followup input,
    .tmti-ca-followup textarea,
    .tmti-ca-other-wrap textarea,
    .tmti-ca-composer textarea {
        background: #ffffff !important;
        color: #172033 !important;
        -webkit-text-fill-color: #172033;
        opacity: 1;
    }

    .tmti-ca-priority-card:has(input:checked) {
        background: #eef4ff !important;
        color: #20324e !important;
    }

    .tmti-ca-composer textarea::placeholder,
    .tmti-ca-followup input::placeholder,
    .tmti-ca-followup textarea::placeholder,
    .tmti-ca-other-wrap textarea::placeholder {
        color: #718096 !important;
        -webkit-text-fill-color: #718096;
        opacity: 1;
    }

    .tmti-ca-message-assistant > div {
        background: #ffffff !important;
        color: #172033 !important;
    }

    .tmti-ca-message-visitor > div {
        background: #2f63d9 !important;
        color: #ffffff !important;
    }
}


/* v0.5.5 authoritative responsive placement.
 * Desktop: Rocky is viewport-positioned from the actual video/form geometry, so it
 * occupies the page's right gutter and behaves like a sticky consultation panel.
 * Mobile/narrow layouts: Rocky remains a bottom launcher and the full label is visible.
 */
@media (min-width: 1024px) {
    .tmti-ca.tmti-ca-desktop-gutter {
        right: auto !important;
        bottom: auto !important;
        z-index: 99990 !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    }

    .tmti-ca.tmti-ca-desktop-gutter > .tmti-ca-panel {
        position: static !important;
        inset: auto !important;
        display: flex;
        width: 100% !important;
        max-width: 100% !important;
        height: min(660px, var(--tmti-ca-desktop-available-height, 660px)) !important;
        max-height: min(660px, var(--tmti-ca-desktop-available-height, 660px)) !important;
        min-height: 430px;
        margin: 0 !important;
        border-radius: 18px !important;
        overflow: hidden !important;
        background: #ffffff !important;
        box-shadow: 0 20px 58px rgba(17, 32, 57, .22) !important;
    }

    .tmti-ca.tmti-ca-desktop-gutter > .tmti-ca-panel[hidden] {
        display: none !important;
    }

    .tmti-ca.tmti-ca-desktop-gutter > .tmti-ca-bubble {
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        background: #192538 !important;
        color: #ffffff !important;
    }

    .tmti-ca.tmti-ca-desktop-gutter.is-open > .tmti-ca-bubble {
        display: none !important;
    }

    .tmti-ca.tmti-ca-desktop-gutter:not(.is-open) > .tmti-ca-bubble {
        display: flex !important;
    }

    .tmti-ca.tmti-ca-desktop-gutter .tmti-ca-header {
        background: #192538 !important;
        color: #ffffff !important;
    }

    .tmti-ca.tmti-ca-desktop-gutter .tmti-ca-workspace {
        max-height: min(46%, 330px) !important;
    }
}

/* Class-based fallback also applies when a wide browser does not have a usable gutter. */
.tmti-ca.tmti-ca-mobile-layout {
    position: fixed !important;
    top: auto !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: 999999 !important;
}

.tmti-ca.tmti-ca-mobile-layout > .tmti-ca-bubble {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    height: 52px !important;
    padding: 0 16px !important;
    border-radius: 26px !important;
    overflow: hidden !important;
    background: #192538 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.tmti-ca.tmti-ca-mobile-layout.is-open > .tmti-ca-bubble {
    display: none !important;
}

.tmti-ca.tmti-ca-mobile-layout > .tmti-ca-bubble .tmti-ca-bubble-label {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
    text-align: left !important;
}

.tmti-ca.tmti-ca-mobile-layout > .tmti-ca-bubble .tmti-ca-avatar,
.tmti-ca.tmti-ca-mobile-layout > .tmti-ca-bubble .tmti-ca-bubble-chevron {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tmti-ca.tmti-ca-mobile-layout > .tmti-ca-panel {
    position: fixed !important;
    left: max(10px, var(--tmti-ca-viewport-left)) !important;
    right: max(10px, calc(100vw - var(--tmti-ca-viewport-left) - var(--tmti-ca-viewport-width))) !important;
    top: calc(var(--tmti-ca-viewport-top) + 10px) !important;
    bottom: calc(100vh - var(--tmti-ca-viewport-top) - var(--tmti-ca-viewport-height) + 10px) !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 22px !important;
}

.tmti-ca.tmti-ca-mobile-layout > .tmti-ca-panel[hidden] {
    display: none !important;
}

@media (max-width: 1023px) {
    .tmti-ca {
        position: fixed !important;
        top: auto !important;
        left: 12px !important;
        right: 12px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .tmti-ca > .tmti-ca-bubble {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 52px !important;
        height: 52px !important;
        padding: 0 16px !important;
        border-radius: 26px !important;
        overflow: hidden !important;
        background: #192538 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    .tmti-ca.is-open > .tmti-ca-bubble {
        display: none !important;
    }

    .tmti-ca > .tmti-ca-bubble .tmti-ca-bubble-label {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        opacity: 1 !important;
        visibility: visible !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        font-size: 14px !important;
        font-weight: 750 !important;
        line-height: 1.2 !important;
        text-align: left !important;
    }

    .tmti-ca > .tmti-ca-bubble .tmti-ca-avatar,
    .tmti-ca > .tmti-ca-bubble .tmti-ca-bubble-chevron {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .tmti-ca > .tmti-ca-panel {
        position: fixed !important;
        left: max(10px, var(--tmti-ca-viewport-left)) !important;
        right: max(10px, calc(100vw - var(--tmti-ca-viewport-left) - var(--tmti-ca-viewport-width))) !important;
        top: calc(var(--tmti-ca-viewport-top) + 10px) !important;
        bottom: calc(100vh - var(--tmti-ca-viewport-top) - var(--tmti-ca-viewport-height) + 10px) !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        border-radius: 22px !important;
    }

    .tmti-ca > .tmti-ca-panel[hidden] {
        display: none !important;
    }
}

/* v0.5.6: header avatar renders correctly + checkmarks only show when selected */
.tmti-ca .tmti-ca-header .tmti-ca-avatar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 28px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: #2f63d9 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    overflow: hidden !important;
}

.tmti-ca .tmti-ca-priority-card .tmti-ca-priority-check {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

.tmti-ca .tmti-ca-priority-card input:checked + .tmti-ca-priority-check {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* v0.5.6: center the mobile launcher label */
.tmti-ca.tmti-ca-mobile-layout > .tmti-ca-bubble .tmti-ca-bubble-label {
    text-align: center !important;
}
/* v0.5.6: center the mobile launcher label */
.tmti-ca .tmti-ca-bubble .tmti-ca-bubble-label,
.tmti-ca > .tmti-ca-bubble .tmti-ca-bubble-label,
.tmti-ca.tmti-ca-mobile-layout > .tmti-ca-bubble .tmti-ca-bubble-label {
    text-align: center !important;
}

/* v0.5.6: modern mobile composer */
@media (max-width: 782px) {
    .tmti-ca .tmti-ca-composer {
        gap: 8px !important;
        align-items: flex-end !important;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
        background: #ffffff !important;
        border-top: 1px solid #e8edf4 !important;
    }

    .tmti-ca .tmti-ca-composer textarea {
        min-height: 44px !important;
        max-height: 110px !important;
        padding: 12px 16px !important;
        border: 1px solid transparent !important;
        border-radius: 22px !important;
        background: #f1f4f9 !important;
        font-size: 16px !important;
        line-height: 1.35 !important;
        box-shadow: none !important;
    }

    .tmti-ca .tmti-ca-composer textarea:focus {
        outline: none !important;
        background: #ffffff !important;
        border-color: #2f63d9 !important;
        box-shadow: 0 0 0 3px rgba(47, 99, 217, .14) !important;
    }

    .tmti-ca .tmti-ca-composer button {
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: linear-gradient(135deg, #3a70e8, #2452b8) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(47, 99, 217, .35) !important;
    }
}

/* v0.5.6: fake blinking caret in the empty mobile composer */
@media (max-width: 782px) {
    .tmti-ca .tmti-ca-composer {
        position: relative !important;
    }

    .tmti-ca .tmti-ca-composer::before {
        content: '';
        position: absolute;
        left: 30px;
        top: 24px;
        width: 2px;
        height: 18px;
        border-radius: 1px;
        background: #172033;
        pointer-events: none;
        animation: tmti-ca-caret 1.1s steps(1) infinite;
    }

    .tmti-ca .tmti-ca-composer:focus-within::before,
    .tmti-ca .tmti-ca-composer:has(textarea:not(:placeholder-shown))::before {
        display: none;
    }

    @keyframes tmti-ca-caret {
        0%, 55% { opacity: 1; }
        56%, 100% { opacity: 0; }
    }
}
@media (min-width: 783px) {
    .tmti-ca-menu-toggle { display:block !important; margin-left:auto !important; color:#ffffff !important; }
    .tmti-ca-header-menu { right:44px; top:54px; }
}
