.widget-panel,
.widget-launcher-wrap {
    --w-surface: #fff;
    --w-soft: #f4f8fc;
    --w-fill: #eaf1f8;
    --w-fill-hover: #dde8f3;
    --w-bubble: #f2f5f8;
    --w-tint: var(--signal-50);
    --w-line: #e3eaf1;
    --w-line-2: #d2dde8;
    --w-line-soft: rgba(10, 45, 73, 0.06);
    --w-text: var(--ink-900);
    --w-text-2: #3f5a70;
    --w-muted: #5b7183;
    --w-muted-2: #7f95a8;
    --w-blue: #1a72bd;
    --w-blue-hover: #166bb0;
    --w-mine: #1a72bd;
    --w-good: #1e7a33;
    --w-good-bg: #e6f5e6;
    --w-warn: #92400e;
    --w-warn-bg: #fef3c7;
    --w-bad: var(--rose-700);
    --w-bad-bg: var(--rose-50);
    --w-navy: #0c2740;

    --r-panel: 1.375rem;
    --r-lg: 1.125rem;
    --r-bubble: 1.25rem;
    --r-tail: 0.375rem;
    --r-md: 0.875rem;
    --r-sm: 0.625rem;
    --r-chip: 0.25rem;
}

.widget-panel :focus-visible:not(.widget-composer-input, .widget-reply-input, .widget-field-input, .widget-field-area) {
    outline: 2px solid var(--signal-500);
    outline-offset: 2px;
}

.widget-empty {
    padding: 2.5rem 0.25rem;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--w-muted);
}

.widget-error {
    margin-top: 0.75rem;
    text-align: center;
    font-size: var(--text-2xs);
    color: var(--w-bad);
}

.widget-pill {
    flex-shrink: 0;
    border-radius: 999px;
    padding: 0.1875rem 0.5rem;
    font-size: var(--text-3xs);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.widget-pill--mute { background: var(--w-fill); color: var(--w-muted); }

.widget-ref {
    font-size: var(--text-3xs);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--w-muted);
}

.widget-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    height: 2.75rem;
    border: 0;
    border-radius: 0.875rem;
    background: var(--w-blue);
    color: #fff;
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 76, 124, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: background-color 0.2s var(--ease-std), transform 0.15s var(--ease-std);
}

.widget-btn-primary:hover { background: var(--w-blue-hover); }
.widget-btn-primary:active { scale: 0.98; }
.widget-btn-primary:disabled { opacity: 0.6; cursor: default; background: var(--w-blue); }

.widget-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.5rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 0.75rem;
    background: var(--w-blue);
    color: #fff;
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s var(--ease-std);
}

.widget-action:hover { background: var(--w-blue-hover); }
.widget-action:active { scale: 0.98; }
.widget-action-glyph { width: 1rem; height: 1rem; }

.widget-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 3.5rem;
    padding: 0.625rem 0.75rem;
}

.widget-icon-btn,
.widget-panel-btn {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    color: var(--w-text-2);
    cursor: pointer;
    transition: background-color 0.2s var(--ease-std), color 0.2s var(--ease-std);
}

.widget-icon-btn:hover,
.widget-icon-btn--on,
.widget-panel-btn:hover { background: var(--w-soft); color: var(--w-text); }
.widget-icon-btn-glyph { width: 1.125rem; height: 1.125rem; }
.widget-panel-icon { width: 1.0625rem; height: 1.0625rem; }

.widget-bot {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: #8fcafc;
    background: radial-gradient(120% 120% at 30% 20%, #17395a 0%, var(--w-navy) 58%, #081d31 100%);
    box-shadow: inset 0 0 0 1px rgba(143, 202, 252, 0.2), 0 2px 6px -2px rgba(6, 27, 45, 0.35);
}

.widget-bot-glyph { width: 54%; height: 54%; }
.widget-bot--teaser { width: 2.125rem; height: 2.125rem; }
.widget-bot--row { width: 2.5rem; height: 2.5rem; }
.widget-bot--head { width: 2.375rem; height: 2.375rem; }
.widget-bot--author { width: 1.25rem; height: 1.25rem; box-shadow: none; }

.widget-halo {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: currentColor;
    pointer-events: none;
}

.widget-launcher-wrap {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: var(--z-widget-launcher);
}

.widget-launcher-wrap > .widget-halo {
    z-index: -1;
    color: var(--signal-500);
    opacity: 0.35;
}

:root[data-widget-open-requested] .widget-launcher-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 999px;
    background: var(--signal-500);
    opacity: 0.35;
    pointer-events: none;
    animation: halo 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

:root[data-widget-open-requested] .widget-launcher {
    cursor: progress;
}

:root[data-widget-open-requested] .widget-launcher::after,
.widget-launcher[aria-busy="true"]::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 3px solid var(--signal-200);
    border-top-color: var(--ink-850);
    border-radius: 999px;
    pointer-events: none;
    animation: widget-launcher-wait 0.9s linear infinite;
}

@keyframes widget-launcher-wait {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root[data-widget-open-requested] .widget-launcher::after,
    .widget-launcher[aria-busy="true"]::after {
        animation: none;
        border-top-color: var(--signal-200);
    }
}

.widget-launcher {
    position: relative;
    display: grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: radial-gradient(120% 120% at 20% 0%, var(--signal-400) 0%, var(--w-blue) 45%, var(--ink-850) 100%);
    cursor: pointer;
    box-shadow:
        0 1px 2px rgba(6, 27, 45, 0.2),
        0 10px 24px -6px rgba(16, 76, 124, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.25s var(--ease-back);
}

.widget-launcher:hover { transform: scale(1.06); }
.widget-launcher:active { transform: scale(0.96); }

.widget-launcher:focus-visible {
    outline: 2px solid var(--signal-500);
    outline-offset: 4px;
}

.widget-launcher-mark,
.widget-launcher-close {
    grid-area: 1 / 1;
    transition: transform 0.35s var(--ease-expo), opacity 0.2s var(--ease-std);
}

.widget-launcher-mark { width: 2rem; height: 2rem; }
.widget-launcher-close { width: 1.5rem; height: 1.5rem; opacity: 0; transform: rotate(-90deg) scale(0.6); }
.widget-launcher--open .widget-launcher-mark { opacity: 0; transform: rotate(90deg) scale(0.6); }
.widget-launcher--open .widget-launcher-close { opacity: 1; transform: none; }

.widget-teaser {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.875rem);
    width: min(18.75rem, calc(100vw - 2.5rem));
    animation: bubble-in 380ms var(--ease-expo) both;
}

.widget-teaser-body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--w-line);
    border-radius: 1.25rem;
    background: var(--w-surface);
    color: var(--w-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(10, 45, 73, 0.05), 0 22px 44px -18px rgba(10, 45, 73, 0.4);
    transition: border-color 0.2s var(--ease-std);
}

.widget-teaser-body:hover { border-color: var(--w-line-2); }

.widget-teaser-body:focus-visible {
    outline: 2px solid var(--signal-500);
    outline-offset: 2px;
}

.widget-teaser-head { display: flex; align-items: center; gap: 0.625rem; padding-right: 1.75rem; }
.widget-teaser-name { font-size: var(--text-sm); font-weight: 600; }

.widget-teaser-text {
    padding: 0.625rem 0.75rem;
    border-radius: 0.25rem 0.875rem 0.875rem 0.875rem;
    background: var(--w-soft);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.widget-teaser-go {
    align-self: flex-end;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--w-blue);
}

.widget-teaser-close {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: none;
    color: var(--w-muted);
    cursor: pointer;
    transition: background-color 0.2s var(--ease-std), color 0.2s var(--ease-std);
}

.widget-teaser-close:hover { background: var(--w-soft); color: var(--w-text); }

.widget-teaser-close:focus-visible {
    outline: 2px solid var(--signal-500);
    outline-offset: 2px;
}

.widget-teaser-close-icon { width: 0.875rem; height: 0.875rem; }

.widget-launcher-badge {
    position: absolute;
    top: -0.1875rem;
    right: -0.1875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 0.3125rem;
    border-radius: 999px;
    background: var(--rose-600);
    color: #fff;
    font-size: var(--text-3xs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    box-shadow: 0 0 0 2px #fff;
}

.widget-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 6.25rem;
    z-index: var(--z-widget-panel);
    display: flex;
    flex-direction: column;
    width: 25rem;
    height: 43.75rem;
    max-height: calc(100vh - 7.5rem);
    overflow: hidden;
    border-radius: var(--r-panel);
    background: var(--w-surface);
    color: var(--w-text);
    transform-origin: bottom right;
    box-shadow:
        0 0 0 1px rgba(10, 45, 73, 0.06),
        0 12px 28px -8px rgba(6, 27, 45, 0.16),
        0 40px 90px -24px rgba(6, 27, 45, 0.38);
    transition: width 0.3s var(--ease-expo), height 0.3s var(--ease-expo);
}

.widget-panel--expanded {
    width: min(35rem, calc(100vw - 2.5rem));
    height: 47.5rem;
}

.widget-panel--in { animation: panel-in 300ms var(--ease-out) backwards; }

.widget-panel--out {
    animation: panel-out 200ms var(--ease-exit) both, panel-gone 0s linear 200ms forwards;
    pointer-events: none;
}

@keyframes panel-gone {
    to { visibility: hidden; }
}

@media (max-width: 40rem), (max-height: 31.25rem) and (pointer: coarse) {
    .widget-panel,
    .widget-panel--expanded {
        top: 0;
        z-index: var(--z-overlay);
        inset-inline: 0;
        bottom: auto;
        width: auto;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }

    .widget-panel-btn--expand,
    .widget-menu-item--expand { display: none; }

    .widget-composer { padding-bottom: calc(0.875rem + env(safe-area-inset-bottom)); }
    .widget-composer:has(+ .widget-person-line) { padding-bottom: 0.375rem; }
    .widget-person-line { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
    .widget-ended { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
    .widget-gate { margin-bottom: calc(1rem + env(safe-area-inset-bottom)); }
    .widget-form { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
    .widget-hours { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
}

.widget-chathead-wrap {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

.widget-chathead {
    gap: 0.625rem;
    min-height: 4.125rem;
    padding: 0.625rem 0.75rem 0.625rem 0.625rem;
    background: var(--w-surface);
    border-bottom: 1px solid var(--w-line);
}

.widget-chathead-titles {
    flex: 1;
    min-width: 0;
    padding-left: 0.125rem;
}

.widget-chathead-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--w-text);
}

.widget-statusline {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    min-width: 0;
    margin-top: 0.125rem;
    font-size: var(--text-2xs);
    color: var(--w-muted);
}

.widget-statusline-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.widget-head-face {
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 999px;
    background: radial-gradient(120% 120% at 30% 20%, #17395a 0%, var(--w-navy) 58%, #081d31 100%);
    color: #fff;
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.widget-head-face--quiet { background: var(--w-fill); color: var(--w-muted); }
.widget-head-face-glyph { width: 1.0625rem; height: 1.0625rem; }

.widget-head-live {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 0.6875rem;
    height: 0.6875rem;
    border: 2px solid var(--w-surface);
    border-radius: 999px;
    background: var(--verdant);
}

.widget-statusdot {
    flex-shrink: 0;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 999px;
}

.widget-statusdot--live { background: var(--verdant); box-shadow: 0 0 0 3px rgba(65, 179, 69, 0.18); }
.widget-statusdot--waiting { background: var(--amber-400); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2); }
.widget-statusdot--ended { background: var(--w-muted-2); }
.widget-statusdot--bot { background: var(--signal-500); }

.widget-menu-wrap { position: relative; }

.widget-menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 4;
    border: 0;
    background: transparent;
    cursor: default;
}

.widget-menu {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    width: 13.125rem;
    padding: 0.375rem;
    border: 1px solid var(--w-line);
    border-radius: var(--r-md);
    background: var(--w-surface);
    box-shadow: 0 18px 40px -12px rgba(10, 45, 73, 0.3);
    animation: bubble-in 220ms var(--ease-expo) both;
    transform-origin: top right;
}

.widget-menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem;
    border: 0;
    border-radius: 0.5625rem;
    background: none;
    color: var(--w-text);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.widget-menu-item:hover { background: var(--w-soft); }
.widget-menu-glyph { width: 1.0625rem; height: 1.0625rem; color: var(--w-text-2); }
.widget-menu-item--danger,
.widget-menu-item--danger .widget-menu-glyph { color: var(--w-bad); }

.widget-confirm {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 0.75rem 0.625rem 1.125rem;
    background: #fff7ed;
    border-bottom: 1px solid #f6dfc3;
    font-size: var(--text-xs);
    font-weight: 600;
    color: #7a3d06;
    animation: rise-in 260ms var(--ease-expo) both;
}

.widget-confirm-text { flex: 1; }

.widget-confirm-keep,
.widget-confirm-end {
    height: 2.125rem;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 0.625rem;
    font: inherit;
    font-size: var(--text-2xs);
    font-weight: 600;
    cursor: pointer;
}

.widget-confirm-keep { background: transparent; color: var(--w-text-2); }
.widget-confirm-keep:hover { background: rgba(10, 45, 73, 0.06); color: var(--w-text); }
.widget-confirm-end { background: var(--rose-700); color: #fff; }
.widget-confirm-end:hover { background: #9f1239; }

.widget-thread {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--w-surface);
}

.widget-thread-fade {
    position: absolute;
    inset-inline: 0;
    top: 0;
    z-index: 10;
    height: 1rem;
    pointer-events: none;
    background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0));
}

.widget-scroll {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.125rem 0.875rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(10, 45, 73, 0.18) transparent;
}

.widget-link {
    display: block;
    margin: 0 auto 0.75rem;
    padding: 0.375rem 0.75rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--w-blue);
    font: inherit;
    font-size: var(--text-2xs);
    font-weight: 600;
    cursor: pointer;
}

.widget-link:hover { background: var(--w-tint); }

.widget-run { margin-top: 0.875rem; }
.widget-run:first-child { margin-top: 0; }
.widget-run--tight { margin-top: 0.25rem; }

.widget-row { display: flex; }

.widget-row--mine {
    justify-content: flex-end;
    padding-left: 2.5rem;
}

.widget-bubble-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: min(88%, 54ch);
}

.widget-row--mine .widget-bubble-wrap { align-items: flex-end; }

.widget-author {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    margin: 0 0 0.375rem 0.125rem;
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--w-text-2);
}

.widget-author-dot {
    flex-shrink: 0;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 999px;
    background: var(--verdant);
}

.widget-bubble {
    padding: 0.6875rem 0.875rem;
    border-radius: var(--r-bubble);
    font-size: var(--text-sm);
    line-height: 1.55;
    overflow-wrap: anywhere;
    transition: opacity 0.3s var(--ease-std);
}

@media (prefers-reduced-motion: no-preference) {
    :is(.widget-run, .widget-run--tight):nth-last-child(1 of .widget-run, .widget-run--tight) .widget-bubble {
        animation: bubble-in 340ms var(--ease-expo) backwards;
    }
}

.widget-bubble--bot {
    border-bottom-left-radius: var(--r-tail);
    transform-origin: bottom left;
    background: var(--w-bubble);
    color: var(--w-text);
}

.widget-bubble--agent {
    border-bottom-left-radius: var(--r-tail);
    transform-origin: bottom left;
    background: var(--w-bubble);
    color: var(--w-text);
}

.widget-bubble--mine {
    border-bottom-right-radius: var(--r-tail);
    transform-origin: bottom right;
    background: var(--w-mine);
    color: #fff;
}

.widget-bubble--muted { opacity: 0.55; }
.widget-bubble--sending { opacity: 0.6; }

.widget-bubble-text { margin: 0; white-space: pre-wrap; }

.widget-time {
    margin-top: 0.3125rem;
    padding: 0 0.375rem;
    font-size: var(--text-3xs);
    font-variant-numeric: tabular-nums;
    color: var(--w-muted);
}

.widget-msg {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: end;
    padding-right: 2.5rem;
}

.widget-msg--mine {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 0 2.5rem;
}

.widget-msg .widget-bubble-wrap { align-items: flex-start; max-width: min(100%, 54ch); }
.widget-msg--mine .widget-bubble-wrap { align-items: flex-end; }

.widget-msg-face { display: flex; width: 1.75rem; }
.widget-msg:has(> .widget-bubble-wrap > .widget-msg-meta) > .widget-msg-face { margin-bottom: 1.3125rem; }

.widget-bot--msg { width: 1.75rem; height: 1.75rem; box-shadow: none; }

.widget-msg-initials {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--w-navy);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.widget-msg-meta {
    margin: 0.3125rem 0 0 0.25rem;
    font-size: var(--text-3xs);
    color: var(--w-muted);
    overflow-wrap: anywhere;
}

.widget-msg--typing { margin-top: 0.875rem; }

.widget-bubble-ask { margin-top: 0.5rem; }

.widget-msg-source {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--w-line-soft);
    color: var(--w-blue);
    font-size: var(--text-xs);
    font-weight: 600;
    text-decoration: none;
}

.widget-msg-source + .widget-msg-source { margin-top: 0.375rem; }
.widget-msg-source:hover .widget-msg-source-title { text-decoration: underline; text-underline-offset: 3px; }
.widget-msg-source-glyph { flex-shrink: 0; width: 0.9375rem; height: 0.9375rem; }
.widget-msg-source-title { min-width: 0; overflow-wrap: anywhere; }
.widget-msg-source-go { flex-shrink: 0; width: 0.8125rem; height: 0.8125rem; margin-left: auto; }

.widget-event {
    margin: 0;
    padding: 0 1rem;
    font-size: var(--text-2xs);
    color: var(--w-muted);
    text-align: center;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.widget-choices {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding-left: 2.25rem;
}

.widget-choice {
    height: 2.25rem;
    padding: 0 1rem;
    border: 1px solid var(--w-line-2);
    border-radius: 999px;
    background: var(--w-surface);
    color: var(--w-text);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    animation: rise-in 420ms var(--ease-expo) backwards;
    transition: background-color 0.2s var(--ease-std), color 0.2s var(--ease-std), border-color 0.2s var(--ease-std);
}

.widget-choice--accent { border-color: var(--w-blue); color: var(--w-blue); }
.widget-choice:hover { border-color: var(--w-blue); background: var(--w-blue); color: #fff; }

.widget-waitline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.375rem;
    margin: 1.25rem 0 0;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--w-text-2);
}

.widget-waitline-dot {
    position: relative;
    width: 0.4375rem;
    height: 0.4375rem;
    margin-right: 0.25rem;
    border-radius: 999px;
    background: var(--amber-400);
}

@media (prefers-reduced-motion: no-preference) {
    .widget-waitline-dot::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6);
        animation: waitline-ring 1.8s var(--ease-std) infinite;
    }
}

@keyframes waitline-ring {
    to { box-shadow: 0 0 0 7px rgba(251, 191, 36, 0); }
}

.widget-waitline-sep { color: var(--w-muted-2); }

.widget-waitline-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--w-blue);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.widget-waitline-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.widget-failed {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
    padding: 0 0.25rem;
    font-size: var(--text-xs);
    color: var(--w-bad);
}

.widget-retry {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.widget-retry:hover { text-decoration: none; }

.widget-sources {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.widget-source {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5625rem 0.625rem;
    border: 1px solid var(--w-line);
    border-radius: 0.75rem;
    background: var(--w-surface);
    color: var(--w-text);
    text-decoration: none;
    transition: border-color 0.2s var(--ease-std);
}

.widget-source:hover { border-color: var(--w-line-2); }

.widget-source-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.5rem;
    color: var(--w-muted);
}

.widget-source-glyph { width: 1.0625rem; height: 1.0625rem; }

.widget-source-text {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    flex: 1;
    min-width: 0;
}

.widget-source-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-xs);
    font-weight: 600;
}

.widget-source-hint { font-size: var(--text-3xs); color: var(--w-muted); }

.widget-source-go {
    width: 0.9375rem;
    height: 0.9375rem;
    flex-shrink: 0;
    color: var(--w-muted-2);
    transition: transform 0.25s var(--ease-std), color 0.25s var(--ease-std);
}

.widget-source:hover .widget-source-go { transform: translate(1px, -1px); color: var(--w-blue); }

.widget-system {
    display: flex;
    justify-content: center;
    padding: 0.375rem 0;
}

.widget-system-text {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
    max-width: 100%;
    padding: 0.3125rem 0.75rem;
    border: 1px solid var(--w-line);
    border-radius: 999px;
    background: var(--w-surface);
    font-size: var(--text-2xs);
    color: var(--w-text-2);
    text-align: center;
}

.widget-system-dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 999px;
    background: var(--verdant);
}

.widget-system-who { font-weight: 600; color: var(--w-text); }

.widget-typing { display: flex; margin-top: 0.875rem; }

.widget-typing-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.8125rem 0.9375rem;
    border-radius: var(--r-bubble);
    border-bottom-left-radius: var(--r-tail);
    background: var(--w-bubble);
    transform-origin: bottom left;
    animation: bubble-in 340ms var(--ease-expo) both;
}

.widget-wave-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    animation: wave 1.2s ease-in-out infinite;
}

.widget-wave-dot:nth-child(2) { animation-delay: 0.15s; }
.widget-wave-dot:nth-child(3) { animation-delay: 0.3s; }
.widget-wave-dot--bot { background: var(--w-muted-2); }
.widget-wave-dot--agent { background: var(--w-muted-2); }

.widget-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.375rem;
    margin-top: 0.875rem;
    padding-left: 2rem;
}

.widget-suggest {
    padding: 0.5rem 0.875rem;
    border: 1.5px solid var(--w-blue);
    border-radius: 999px;
    background: var(--w-surface);
    color: var(--w-blue);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    animation: rise-in 420ms var(--ease-expo) backwards;
    animation-delay: var(--stagger, 0ms);
    transition: background-color 0.2s var(--ease-std), color 0.2s var(--ease-std);
}

.widget-suggest:hover { background: var(--w-blue); color: #fff; }

.widget-note {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
    margin-top: 1rem;
    padding: 1.125rem;
    border: 1px solid var(--w-line);
    border-radius: 1.25rem;
    background: var(--w-surface);
    box-shadow: 0 1px 2px rgba(10, 45, 73, 0.04), 0 12px 28px -18px rgba(10, 45, 73, 0.3);
    animation: rise-in 420ms var(--ease-expo) both;
}

.widget-note-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.375rem;
    border-radius: 0.75rem;
    background: var(--w-good-bg);
    color: var(--w-good);
}

.widget-note-glyph { width: 1.1875rem; height: 1.1875rem; }

.widget-note-title {
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.3;
    color: var(--w-text);
    overflow-wrap: anywhere;
}

.widget-note-text {
    font-size: var(--text-xs);
    line-height: 1.55;
    color: var(--w-text-2);
}

.widget-note-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-2xs);
    color: var(--w-muted);
}

.widget-note-meta-glyph { width: 0.875rem; height: 0.875rem; }

.widget-note .widget-action { margin-top: 0.5rem; }

.widget-queue-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--w-warn);
}

.widget-queue-dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.widget-queue-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    align-self: stretch;
    margin: 0.625rem -1.125rem -1.125rem;
    padding: 0.625rem 1.125rem;
    border-top: 1px solid var(--w-line);
    border-radius: 0 0 1.25rem 1.25rem;
    background: var(--w-soft);
}

.widget-queue-foot-text { font-size: var(--text-2xs); color: var(--w-text-2); }

.widget-queue-action {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0.25rem 0.125rem;
    border: 0;
    background: transparent;
    color: var(--w-blue);
    font: inherit;
    font-size: var(--text-2xs);
    font-weight: 600;
    cursor: pointer;
}

.widget-queue-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.widget-queue-action-icon { width: 0.875rem; height: 0.875rem; }

.widget-filed {
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid var(--w-line);
    border-radius: 1rem;
    background: var(--w-surface);
    animation: rise-in 420ms var(--ease-expo) both;
}

.widget-filed-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 1rem 1rem 0;
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--w-text-2);
}

.widget-filed-check {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 999px;
    background: var(--verdant);
    color: #fff;
}

.widget-filed-check-glyph { width: 0.6875rem; height: 0.6875rem; }

.widget-filed-ref { margin-left: auto; font-size: inherit; }

.widget-filed-title {
    margin: 0.5rem 0 1rem;
    padding: 0 1rem;
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.35;
    color: var(--w-text);
    overflow-wrap: anywhere;
}

.widget-filed-progress { padding: 0 1rem; }

.widget-filed-note {
    margin: 0.25rem 0 0;
    font-size: var(--text-2xs);
    line-height: 1.5;
    color: var(--w-muted);
}

.widget-filed-open {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 2.875rem;
    margin-top: 1rem;
    padding: 0 0.875rem 0 1rem;
    border: 0;
    border-top: 1px solid var(--w-line);
    background: var(--w-surface);
    color: var(--w-blue);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s var(--ease-std);
}

.widget-filed-open:hover { background: var(--w-soft); }

.widget-filed-open-glyph {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s var(--ease-std);
}

.widget-filed-open:hover .widget-filed-open-glyph { transform: translateX(2px); }

.widget-filed-open:focus-visible { outline-offset: -2px; }

.widget-jump {
    position: absolute;
    inset-inline: 0;
    bottom: 0.75rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: fit-content;
    margin-inline: auto;
    padding: 0.375rem 0.75rem;
    border: 0;
    border-radius: 999px;
    background: var(--w-blue);
    color: #fff;
    font: inherit;
    font-size: var(--text-2xs);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px -8px rgba(10, 45, 73, 0.45);
    animation: rise-in 260ms var(--ease-expo) both;
}

.widget-jump:hover { background: var(--w-blue-hover); }
.widget-jump-glyph { width: 0.875rem; height: 0.875rem; }

.widget-ended {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex-shrink: 0;
    padding: 0.875rem 0.875rem 1rem;
    border-top: 1px solid var(--w-line);
    background: var(--w-surface);
}

.rating + .widget-ended { padding-top: 0; border-top: 0; }

.widget-ended-text {
    margin: 0;
    text-align: center;
    font-size: var(--text-2xs);
    color: var(--w-muted);
}

.widget-ended-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: var(--w-navy);
    color: #fff;
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s var(--ease-std);
}

.widget-ended-btn:hover { background: var(--ink-850); }

.widget-composer {
    position: relative;
    flex-shrink: 0;
    padding: 0.5rem 0.875rem 0.875rem;
    background: var(--w-surface);
}

.widget-composer:has(+ .widget-person-line) { padding-bottom: 0.375rem; }

.widget-person-line {
    flex-shrink: 0;
    margin: 0;
    padding: 0 1rem 0.75rem;
    background: var(--w-surface);
    text-align: center;
    font-size: var(--text-2xs);
    color: var(--w-muted);
}

.widget-person-line-btn {
    padding: 0.125rem 0;
    border: 0;
    background: none;
    color: var(--w-blue);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.widget-person-line-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.widget-composer-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.125rem;
    padding: 0.3125rem 0.3125rem 0.3125rem 1rem;
    border: 1px solid var(--w-line);
    border-radius: 1.5rem;
    background: var(--w-surface);
    transition: border-color 0.2s var(--ease-std);
}

.widget-composer-bar:focus-within { border-color: var(--w-blue); }

.widget-composer-bar:has(.widget-composer-input:disabled) { opacity: 0.55; }

.widget-composer-input {
    flex: 1;
    min-width: 0;
    min-height: 2.25rem;
    max-height: 7.5rem;
    padding: 0.4375rem 0;
    border: 0;
    background: transparent;
    color: var(--w-text);
    font: inherit;
    font-size: var(--text-sm);
    line-height: 1.5;
    outline: none;
    resize: none;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(10, 45, 73, 0.22) transparent;
}

.widget-composer-input::placeholder { color: var(--w-muted-2); }

.widget-composer-bar .att-btn { width: 2.25rem; height: 2.25rem; border-radius: 999px; }

.widget-composer-count {
    margin: 0.375rem 0.75rem 0;
    font-size: var(--text-2xs);
    text-align: right;
}

.widget-send {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--w-blue);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s var(--ease-std), transform 0.2s var(--ease-back);
}

.widget-send:hover { background: var(--w-blue-hover); transform: scale(1.04); }
.widget-send:active { scale: 0.92; }

.widget-composer-bar:has(.widget-composer-input:placeholder-shown) .widget-send,
.widget-send:disabled {
    pointer-events: none;
    background: #e3e9ef;
    color: #fff;
}

.widget-send-icon { width: 1rem; height: 1rem; }

.widget-gate {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0.5rem 0.875rem 0.875rem;
    padding: 1.125rem;
    border: 1px solid var(--w-line);
    border-radius: 1.25rem;
    background: var(--w-surface);
    box-shadow: 0 1px 2px rgba(10, 45, 73, 0.04), 0 12px 28px -18px rgba(10, 45, 73, 0.3);
    animation: rise-in 420ms var(--ease-expo) both;
}

.widget-gate--working { align-items: center; text-align: center; }

.widget-gate-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
    background: var(--w-tint);
    color: var(--w-blue);
}

.widget-gate-glyph { width: 1.25rem; height: 1.25rem; }

.widget-gate-search {
    position: relative;
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 0.75rem;
    border-radius: 999px;
    background: var(--w-good-bg);
    color: var(--w-good);
}

.widget-gate-search::before,
.widget-gate-search::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 1.5px solid rgba(65, 179, 69, 0.45);
    animation: halo 1.8s var(--ease-std) infinite;
}

.widget-gate-search::after { animation-delay: 0.9s; }

.widget-gate-title {
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--w-text);
}

.widget-gate-text {
    margin-top: 0.375rem;
    font-size: var(--text-xs);
    line-height: 1.6;
    color: var(--w-text-2);
}

.widget-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.875rem 1rem 1rem;
    animation: rise-in 420ms var(--ease-expo) both;
}

.widget-form-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.375rem;
    margin: -0.375rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(10, 45, 73, 0.22) transparent;
}

.widget-form .widget-gate-actions { margin-top: 1.25rem; }
.widget-form .widget-gate-text { margin-top: 0.5rem; }
.widget-form .att-form-row { margin-top: 0.875rem; }

.widget-field {
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
    margin-top: 0.875rem;
}

.widget-field-pair > .widget-field { margin-top: 0; }

.widget-field--grow {
    flex: 1;
    min-height: 0;
}

.widget-field--grow .widget-field-area {
    flex: 1;
    min-height: 7rem;
}

.widget-field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--w-text);
}

.widget-field-count {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: transparent;
    transition: color 0.2s var(--ease-std);
}

.widget-field-count--near { color: var(--w-warn); }

.widget-field-input,
.widget-field-area {
    width: 100%;
    border: 1px solid var(--w-line-2);
    border-radius: 0.75rem;
    background: var(--w-surface);
    color: var(--w-text);
    font: inherit;
    font-size: var(--text-sm);
    outline: none;
    transition: border-color 0.2s var(--ease-std), box-shadow 0.2s var(--ease-std);
}

.widget-field-input { height: 2.75rem; padding: 0 0.875rem; }
.widget-field-area { padding: 0.75rem 0.875rem; resize: none; line-height: 1.6; }

.widget-field-input:hover,
.widget-field-area:hover { border-color: var(--w-muted-2); }

.widget-field-input:focus,
.widget-field-area:focus {
    border-color: var(--signal-500);
    box-shadow: 0 0 0 4px rgba(36, 148, 242, 0.14);
}

.widget-field-input::placeholder,
.widget-field-area::placeholder { color: var(--w-muted-2); }

.widget-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    align-self: stretch;
    margin-top: 1rem;
}

.widget-gate-secondary,
.widget-gate-cancel {
    align-self: stretch;
    border: 0;
    padding: 0.5rem 0;
    background: transparent;
    color: var(--w-text-2);
    font: inherit;
    font-size: var(--text-2xs);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: color 0.2s var(--ease-std), background-color 0.2s var(--ease-std);
}

.widget-gate-secondary:hover,
.widget-gate-cancel:hover { color: var(--w-text); background: var(--w-soft); }

.prose-chat > :first-child { margin-top: 0; }
.prose-chat > :last-child { margin-bottom: 0; }
.prose-chat p { margin: 0 0 0.5rem; }
.prose-chat p:last-child { margin-bottom: 0; }
.prose-chat a { color: var(--w-blue); text-decoration: underline; text-underline-offset: 2px; }
.prose-chat ul,
.prose-chat ol { margin: 0.375rem 0; padding-left: 1.125rem; list-style: disc; }
.prose-chat ol { list-style: decimal; }
.prose-chat li { margin: 0.1875rem 0; }
.prose-chat li::marker { color: var(--w-blue); font-weight: 600; }
.prose-chat strong { font-weight: 600; }

.prose-chat code {
    padding: 0.0625rem 0.25rem;
    border-radius: var(--r-chip);
    background: rgba(10, 45, 73, 0.08);
    font-size: var(--text-xs);
}

.rating {
    flex-shrink: 0;
    padding: 1rem 1rem 0.75rem;
    border-top: 1px solid var(--w-line);
    background: var(--w-surface);
}

.rating-question {
    margin-bottom: 0.25rem;
    text-align: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--w-text);
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 0.125rem;
}

.rating-star {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.625rem;
    padding: 0;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    color: #c3d1de;
    cursor: pointer;
    transition:
        color 0.15s var(--ease-std),
        transform 0.2s var(--ease-back);
}

.rating-star-icon {
    width: 1.75rem;
    height: 1.75rem;
    fill: transparent;
    transition: fill 0.15s var(--ease-std);
}

.rating-stars:hover .rating-star { color: #f5b301; }
.rating-stars:hover .rating-star-icon { fill: #f5b301; }
.rating-star:hover ~ .rating-star { color: #c3d1de; }
.rating-star:hover ~ .rating-star .rating-star-icon { fill: transparent; }
.rating-star:hover:not(:disabled) { transform: scale(1.12); }

.rating-star:disabled {
    opacity: 0.5;
    cursor: default;
}

.rating-given {
    display: flex;
    justify-content: center;
    gap: 0.125rem;
    margin: 0.25rem 0 0.25rem;
}

.rating-given-star { width: 1.125rem; height: 1.125rem; color: #c3d1de; fill: transparent; }
.rating-given-star--on { color: #f5b301; fill: #f5b301; }

@media (prefers-reduced-motion: reduce) {
    .widget-typing-bubble,
    .widget-menu,
    .widget-confirm,
    .widget-suggest,
    .widget-choice,
    .widget-note,
    .widget-filed,
    .widget-gate,
    .widget-form,
    .widget-jump,
    .widget-teaser,
    .widget-panel--in {
        animation: none;
    }

    .widget-filed-open-glyph { transition: none; }

    .widget-wave-dot { animation: none; opacity: 0.35; }
    .widget-gate-search::before,
    .widget-gate-search::after { animation: none; opacity: 0; }

    .widget-panel--out { animation: none; opacity: 0; visibility: hidden; }

    :root[data-widget-open-requested] .widget-launcher-wrap::before { animation: none; }
}

.widget-offline-note {
    margin: 0 0 0.5rem;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--w-warn-bg);
    color: var(--w-warn);
    font-size: var(--text-xs);
    font-weight: 500;
}

.widget-offline-note[hidden] { display: none; }

.widget-file-hint {
    margin: 0 1rem 0.5rem;
    font-size: var(--text-xs);
    color: var(--w-muted);
}

.widget-file-hint:empty { display: none; }

@media (pointer: coarse) and (max-width: 40rem), (pointer: coarse) and (max-height: 31.25rem) {
    .widget-panel[role="dialog"] :is(.widget-icon-btn, .widget-panel-btn, .widget-send, .att-btn) {
        width: 2.75rem;
        height: 2.75rem;
    }

    .widget-panel[role="dialog"] :is(.widget-suggest, .widget-action, .widget-menu-item, .widget-person-line-btn) {
        min-height: 2.75rem;
    }

    .widget-panel[role="dialog"] :is(.widget-composer-input, .widget-field-input) { font-size: 1rem; }
}
