html.widget-document { height: 100%; overflow: hidden; }
.widget-frame { margin: 0; height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column; font-family: var(--font-sans); font-size: var(--fs-14); line-height: var(--lh-text); color: var(--text-1); background: var(--surface); }
.widget-frame * { box-sizing: border-box; }
.widget-frame button, .widget-frame textarea { font: inherit; }
.widget-frame button { cursor: pointer; }
.widget-frame button:disabled { opacity: .5; cursor: wait; }
.widget-frame header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-1); background: var(--surface); flex-shrink: 0; cursor: move; touch-action: none; }
.widget-frame .widget-project-avatar { position: relative; display: block; flex: none; width: 40px; height: 40px; }
.widget-frame .widget-header-identity { flex: 1; min-width: 0; }
.widget-frame .widget-header-identity strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-16); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.widget-frame .widget-header-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; font-size: var(--fs-12); line-height: var(--lh-tight); color: var(--text-3); }
.widget-frame .widget-header-actions { display: flex; align-items: center; gap: 3px; flex: none; }
.widget-frame .widget-header-actions button { display: grid; place-items: center; margin: 0; width: 28px; height: 28px; padding: 6px; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--text-2); }
.widget-frame .widget-header-actions button:hover { background: transparent; color: var(--text-1); }
.widget-frame .widget-header-actions button[hidden] { display: none; }
.widget-frame .widget-header-actions button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.widget-frame .widget-header-actions svg { width: 16px; height: 16px; }
.widget-frame .widget-frame__back { display: grid; place-items: center; flex: none; width: 24px; margin: 0; padding: 0; border: 0; background: none; color: var(--text-2); }
.widget-frame .widget-frame__back:hover { color: var(--text-1); }
.widget-frame .widget-frame__intro { display: flex; flex-direction: column; align-items: center; flex: 1; min-height: 0; width: 100%; overflow: auto; margin: auto; padding: 20px 28px; text-align: center; }
.widget-frame .widget-frame__intro > * { flex-shrink: 0; }
.widget-frame .symbol { display: none; }
.widget-frame .widget-frame__intro h1 { margin: 0 0 8px; font-size: var(--fs-24); font-weight: var(--fw-bold); line-height: var(--lh-tight); color: var(--text-1); }
.widget-frame .widget-frame__intro > p:not(.hint) { margin: 0 0 10px; max-width: 280px; color: var(--text-2); font-size: var(--fs-14); line-height: var(--lh-text); }
.widget-frame .widget-frame__intro .hint { margin: 12px auto; max-width: 270px; color: var(--text-3); font-size: var(--fs-12); line-height: var(--lh-text); }
.widget-frame .widget-frame__intro label { width: 100%; text-align: left; color: var(--text-2); font-size: var(--fs-12); }
.widget-frame .widget-frame__intro select { display: block; width: 100%; padding: 10px; margin: 8px 0 16px; border: 1px solid var(--border-2); border-radius: var(--radius-m); background: var(--bg-3); color: var(--text-1); }
.widget-frame .widget-frame__intro .chat-select-trigger { margin: 8px 0 14px; border-color: var(--border-1); border-radius: var(--radius-m); background: var(--bg-3); }
.widget-frame .widget-frame__captcha { margin: 12px auto; max-width: 100%; }
.widget-frame .primary { min-height: 46px; border: 0; border-radius: var(--radius-l); padding: 13px 20px; font-size: var(--fs-14); font-weight: var(--fw-bold); background: var(--widget-accent, var(--accent)); color: var(--widget-on-accent, var(--text-inverse)); }
.widget-frame .primary:hover { filter: brightness(1.04); }
.widget-frame .widget-frame__cta { width: 100%; }
.widget-frame .widget-frame__cta--secondary { background: var(--bg-3); color: var(--text-2); }
.widget-frame .widget-frame__cta--secondary:hover { background: var(--bg-4); color: var(--text-1); filter: none; }
.widget-frame .widget-contact-channels { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; flex: 0 0 auto; width: 100%; max-width: 280px; margin: 0 auto; padding: 0; align-content: start; align-items: start; grid-auto-rows: max-content; }
.widget-frame .widget-contact-channels a, .widget-frame .widget-contact-channels button { display: flex; align-items: center; align-self: start; gap: 10px; min-height: 60px; padding: 8px 12px; border: 1px solid var(--border-1); border-radius: var(--radius-l); color: var(--text-1); background: var(--bg-2); font: inherit; font-size: var(--fs-12); line-height: var(--lh-tight); text-decoration: none; }
.widget-frame .widget-contact-channels a:hover, .widget-frame .widget-contact-channels button:hover { background: var(--bg-3); }
.widget-frame .widget-contact-channels a:focus-visible, .widget-frame .widget-contact-channels button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.widget-frame .widget-channel-svg { width: 24px; height: 24px; flex: none; color: var(--text-2); }
.widget-frame .widget-channel-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.widget-frame .widget-channel-copy strong { font-size: var(--fs-14); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.widget-frame .widget-channel-copy small { font-size: var(--fs-12); font-weight: var(--fw-regular); line-height: var(--lh-tight); color: var(--text-2); overflow-wrap: anywhere; }
.widget-frame .widget-frame__chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.widget-frame .widget-frame__messages { overflow: auto; flex: 1; min-height: 0; padding: 18px 16px; background: var(--chat-bg); scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.widget-frame .bubble { width: fit-content; min-width: 96px; min-height: 40px; max-width: 88%; margin: 10px auto 10px 0; padding: 11px 14px; border: 1px solid var(--bubble-in-border); border-radius: var(--radius-l) var(--radius-l) var(--radius-l) var(--radius-s); background: var(--bubble-in); color: var(--text-1); white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--lh-text); }
.widget-frame .bubble.own { margin-left: auto; margin-right: 0; border-color: var(--bubble-out-border); background: var(--bubble-out); border-radius: var(--radius-l) var(--radius-l) var(--radius-s) var(--radius-l); }
.widget-frame .bubble small { display: block; margin-top: 6px; font-size: var(--fs-12); color: var(--bubble-meta); }
.widget-frame .bubble .attachment { color: var(--link); font-size: var(--fs-12); }
.widget-frame .bubble.service { margin: 10px auto; min-height: 0; padding: 6px 12px; border-style: dashed; background: transparent; color: var(--text-2); font-size: var(--fs-12); text-align: center; }
.widget-frame .bubble.service a { color: var(--link); }

.widget-frame .bubble.widget-invite-message small.widget-invite-message__from { margin: 0 0 4px; font-weight: var(--fw-bold); color: var(--text-2); }
.widget-frame .attachment { display: block; overflow-wrap: anywhere; margin-top: 8px; }
.widget-frame .widget-frame__older { border: 0; padding: 8px; color: var(--text-3); font-size: var(--fs-12); background: var(--bg-2); }
.widget-frame .typing-indicator { flex: none; min-height: 18px; margin: 3px 16px; font-size: var(--fs-12); color: var(--text-3); background: var(--surface); }
.widget-frame .typing-indicator:empty, .widget-frame .widget-frame__status:empty { display: none; }
.widget-frame .widget-frame__composer { flex: none; min-width: 0; margin: 0; box-shadow: none; }
.widget-frame .widget-frame__status { flex: none; margin: 6px 0; padding: 0 20px; text-align: center; font-size: var(--fs-12); color: var(--text-3); }
.widget-frame footer { flex: none; padding: 10px 16px 12px; border-top: 1px solid var(--border-1); text-align: center; font-size: var(--fs-12); line-height: var(--lh-tight); color: var(--text-3); background: var(--surface); }
.widget-frame footer a { color: var(--text-2); text-decoration: none; }
.widget-frame .widget-pending-actions { display: flex; gap: 8px; margin-top: 6px; }
.widget-frame .widget-pending-actions button { border: 0; background: transparent; padding: 2px 0; font-size: var(--fs-12); color: inherit; }
.widget-frame.widget-restoring .widget-frame__intro { display: none; }
.widget-frame.widget-restoring .widget-frame__chat { visibility: hidden; }
.widget-frame .widget-frame__loading { position: absolute; inset: 80px 0 50px; display: none; align-items: center; justify-content: center; gap: 10px; font-size: var(--fs-12); color: var(--text-3); pointer-events: none; }
.widget-frame.widget-restoring .widget-frame__loading { display: flex; }
.widget-frame .widget-loading-dot { width: 12px; height: 12px; border: 2px solid var(--border-1); border-top-color: var(--text-3); border-radius: 50%; animation: widget-loading 1s linear infinite; }
@keyframes widget-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .widget-frame .widget-loading-dot { animation: none; } }
@media (max-height: 480px) { .widget-frame .widget-frame__intro { padding: 14px 20px; } .widget-frame .widget-frame__intro h1 { font-size: var(--fs-20); } }
@media (max-width: 600px) {
    .widget-frame .widget-contact-channels a, .widget-frame .widget-contact-channels button { height: 64px; min-height: 64px; max-height: 64px; padding: 8px 12px; }
    .widget-frame .widget-channel-copy { flex: 1; }
    .widget-frame .widget-channel-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .widget-frame .widget-channel-copy small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
}
.widget-frame.widget-keyboard-open footer { padding-top: 2px; padding-bottom: 2px; }

.widget-frame .widget-frame__captcha:empty,
.widget-frame .widget-frame__intro > p:not(.hint):empty { display: none; }

.message-code:where(.widget-frame *){font-family:var(--font-mono);font-size:var(--fs-14);padding:.05em .35em;border-radius:var(--radius-s);background:color-mix(in srgb,currentColor 8%,transparent)}
.message-pre:where(.widget-frame *){display:block;margin:4px 0;padding:8px 10px;border-radius:var(--radius-s);background:color-mix(in srgb,currentColor 6%,transparent);font-family:var(--font-mono);font-size:var(--fs-14);line-height:var(--lh-text);white-space:pre;overflow-x:auto}
.message-pre:where(.widget-frame *) code{font:inherit}
.message-blockquote:where(.widget-frame *){margin:2px 0;padding:0 0 0 10px;border-left:3px solid color-mix(in srgb,currentColor 25%,transparent)}
.message-spoiler:where(.widget-frame *){border-radius:var(--radius-s);background:color-mix(in srgb,currentColor 21%,transparent);cursor:pointer}
.message-spoiler:not(:focus-within):where(.widget-frame *)>span{visibility:hidden}
.message-spoiler:focus-within:where(.widget-frame *){background:color-mix(in srgb,currentColor 7%,transparent);outline:none}

.widget-frame .bubble.has-buttons{position:relative;min-width:min(240px,88%);margin-bottom:calc(10px + var(--button-rows,1) * 42px)}
.message-buttons:where(.widget-frame *){position:absolute;left:-1px;right:-1px;top:calc(100% + 4px);display:flex;flex-direction:column;gap:4px;white-space:normal}
.message-buttons__row:where(.widget-frame *){display:flex;gap:4px}
.message-button:where(.widget-frame *){display:flex;align-items:center;justify-content:center;flex:1 1 0;min-width:0;height:38px;padding:0 12px;border:1px solid var(--bubble-in-border);border-radius:var(--radius-m);background:var(--bubble-in);color:var(--link);font:inherit;font-size:var(--fs-14);font-weight:var(--fw-medium);line-height:var(--lh-tight);text-align:center;text-decoration:none;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.message-button:hover:where(.widget-frame *){background:color-mix(in srgb,var(--bubble-in) 88%,currentColor)}
.message-button:focus-visible:where(.widget-frame *){outline:2px solid var(--focus);outline-offset:1px}
.message-button.is-waiting:where(.widget-frame *){opacity:.6;cursor:progress}
.message-button--link:where(.widget-frame *)::after{content:" ↗";opacity:.7}

.bot-commands-host:where(.widget-frame *){position:relative}
.bot-command-menu:where(.widget-frame *){position:absolute;left:0;right:0;bottom:calc(100% + 6px);z-index:30;max-height:260px;overflow-y:auto;padding:4px;border:1px solid var(--border-2);border-radius:var(--radius-m);background:var(--surface);color:var(--text-1);box-shadow:var(--shadow)}
.bot-command-menu:where(.widget-frame *) button{display:flex;gap:10px;align-items:baseline;width:100%;padding:8px 10px;border:0;border-radius:var(--radius-s);background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.bot-command-menu:where(.widget-frame *) button[aria-selected=true],.bot-command-menu:where(.widget-frame *) button:hover{background:var(--bg-4)}
.bot-command-menu:where(.widget-frame *) strong{font-weight:var(--fw-bold);white-space:nowrap}
.bot-command-menu:where(.widget-frame *) span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:.75}
.message-command:where(.widget-frame *){padding:0;border:0;background:none;color:var(--link);font:inherit;text-decoration:underline;text-underline-offset:2px;cursor:pointer}

.bot-keyboard:where(.widget-frame *){display:flex;flex-direction:column;gap:4px;padding:6px 12px 4px}
.bot-keyboard__row:where(.widget-frame *){display:flex;gap:4px}
.bot-keyboard__button:where(.widget-frame *){flex:1 1 0;min-width:0;padding:9px 10px;border:1px solid var(--border-2);border-radius:var(--radius-m);background:var(--bg-3);color:inherit;font:inherit;font-size:var(--fs-14);cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bot-keyboard__button:hover:where(.widget-frame *){background:var(--bg-4)}
.bot-keyboard__button:focus-visible:where(.widget-frame *){outline:2px solid var(--focus);outline-offset:1px}
.message-button--app:where(.widget-frame *)::after{content:" ⧉";opacity:.7}

.composer-format-bar:where(.widget-frame *){position:fixed;z-index:1000;display:flex;align-items:center;gap:2px;padding:4px;border:1px solid var(--border-2);border-radius:var(--radius-m);background:var(--surface);color:var(--text-1);box-shadow:var(--shadow);animation:composer-format-bar-in .12s ease-out}.composer-format-bar:where(.widget-frame *)[hidden]{display:none}.composer-format-bar:where(.widget-frame *) button{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--radius-s);background:none;color:var(--text-2);cursor:pointer}.composer-format-bar:where(.widget-frame *) button:hover,.composer-format-bar:where(.widget-frame *) button:focus-visible{background:var(--bg-3);color:var(--text-1);outline:none}.composer-format-bar:where(.widget-frame *) button[aria-pressed=true]{background:var(--info-soft);color:var(--accent)}.composer-format-bar:where(.widget-frame *) svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.composer-format-bar__sep:where(.widget-frame *){width:1px;height:20px;margin:0 3px;background:var(--border-2)}@keyframes composer-format-bar-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion:reduce){.composer-format-bar:where(.widget-frame *){animation:none}}

.widget-frame .widget-frame__requests { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; padding: 16px 14px; background: var(--surface); }
.widget-frame .widget-frame__requests[hidden] { display: none; }
.widget-frame .widget-frame__requests h2 { margin: 2px 4px 12px; font-size: var(--fs-16); font-weight: var(--fw-bold); line-height: var(--lh-tight); color: var(--text-1); }
.widget-frame .widget-request-list { display: grid; gap: 6px; align-content: start; }
.widget-frame .widget-request-list__loading { margin: 8px 4px; font-size: var(--fs-12); color: var(--text-3); }
.widget-frame .widget-request { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; margin: 0; padding: 10px 12px; border: 1px solid var(--border-1); border-radius: var(--radius-l); background: var(--bg-2); color: var(--text-1); text-align: left; }
.widget-frame .widget-request:hover { background: var(--bg-3); }
.widget-frame .widget-request:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.widget-frame .widget-request__copy { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.widget-frame .widget-request__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-14); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.widget-frame .widget-request__copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); line-height: var(--lh-tight); color: var(--text-2); }
.widget-frame .widget-request.has-unread .widget-request__copy small { color: var(--text-1); font-weight: var(--fw-medium); }
.widget-frame .widget-request__side { flex: none; display: flex; align-items: center; font-size: var(--fs-12); color: var(--text-3); }
.widget-frame .widget-request__badge { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full, 999px); background: var(--widget-accent, var(--accent)); color: var(--widget-on-accent, var(--text-inverse)); font-size: var(--fs-12); font-weight: var(--fw-bold); line-height: 1; }
.widget-frame .widget-request__write { padding: 5px 10px; border-radius: var(--radius-full, 999px); background: var(--bg-3); color: var(--text-2); font-weight: var(--fw-medium); }
.widget-frame.widget-restoring .widget-frame__requests { visibility: hidden; }

.widget-frame.widget-page { height: var(--visible-height, 100dvh); background: var(--bg-2); }
html[data-keyboard-open] .widget-frame.widget-page { position: fixed; top: var(--visible-top, 0px); left: 0; width: 100%; }
.widget-frame .widget-page__column { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-width: 760px; margin: 0 auto; background: var(--surface); }
.widget-frame.widget-page header { cursor: default; touch-action: auto; padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 12px calc(16px + env(safe-area-inset-left)); }
.widget-frame.widget-page .widget-frame__messages, .widget-frame.widget-page .widget-frame__requests { padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
.widget-frame.widget-page footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.widget-frame.widget-page.widget-keyboard-open footer { display: none; }
.widget-frame.widget-page .widget-frame__intro > p:not(.hint) { max-width: 420px; }
.widget-frame.widget-page .widget-contact-channels { max-width: 360px; }
.widget-frame .widget-header-identity .widget-page__meta { display: flex; gap: 6px; min-width: 0; }
.widget-frame .widget-header-identity .widget-page__meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-frame .widget-header-identity .widget-page__meta > span:empty { display: none; }
.widget-frame .widget-header-identity .widget-page__meta > span:not(:empty) + span::before { content: "·"; margin-right: 6px; }
.widget-frame .widget-page__status[data-online="true"] { color: var(--success); }
@media (min-width: 800px) {
    .widget-frame .widget-page__column { border-left: 1px solid var(--border-1); border-right: 1px solid var(--border-1); }
    .widget-frame.widget-page .widget-frame__intro { justify-content: center; }
}
