.help-dialog {
  --chat-surface: #171e21;
  --chat-raised: #232d31;
  --chat-user: #263d36;
  --chat-line: #384449;
  --chat-text: #f0f4f2;
  --chat-secondary: #a7b6b5;
  --chat-accent: #b8e8d2;
  --chat-accent-ink: #112b24;
  width: min(424px, calc(100% - 32px));
  height: min(536px, calc(100dvh - 112px));
  max-height: none;
  border: 1px solid var(--chat-line);
  background: var(--chat-surface);
  color: var(--chat-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
}
.help-dialog header { flex-shrink: 0; padding: 12px 16px; border-color: var(--chat-line); }
.help-dialog header h2 { color: var(--chat-text); font-size: 15px; font-weight: 650; }
.help-dialog header .chat-mark { color: var(--chat-accent); }
.help-dialog header .chat-mark i { background: var(--chat-surface); }
.help-dialog .help-close { color: var(--chat-secondary); flex: 0 0 36px; height: 36px; }
.help-dialog .help-close:hover { background: var(--chat-raised); color: var(--chat-text); }
.help-messages { min-height: 0; padding: 20px 16px; gap: 12px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--chat-line) transparent; }
.help-message { max-width: 91%; font-size: inherit; line-height: inherit; background: var(--chat-raised); color: var(--chat-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.help-message.question { background: var(--chat-user); }
.help-session-notice { align-self: center; color: var(--chat-secondary); font-size: 12px; text-align: center; line-height: 1.5; }
.help-message.waiting { display: flex; align-items: center; gap: 8px; color: var(--chat-secondary); animation: none; }
.help-wait-mark { display: inline-flex; align-items: center; gap: 3px; height: 16px; }
.help-wait-mark i { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--chat-accent); animation: help-wave 1.2s ease-in-out infinite; }
.help-wait-mark i:nth-child(2) { animation-delay: .12s; }
.help-wait-mark i:nth-child(3) { animation-delay: .24s; }
@keyframes help-wave { 0%, 72%, 100% { transform: translateY(0); opacity: .5; } 36% { transform: translateY(-3px); opacity: 1; } }
.help-topics { flex-shrink: 0; gap: 6px; padding: 0 16px 12px; }
.help-topics button { background: transparent; border-color: var(--chat-line); color: var(--chat-text); font-size: 12px; }
.help-topics button:hover { background: var(--chat-raised); border-color: var(--chat-secondary); }
.help-form { flex-shrink: 0; margin: 0 16px; padding: 4px; align-items: end; gap: 4px; border: 1px solid var(--chat-line); border-radius: 12px; background: var(--chat-surface); }
.help-form:focus-within { border-color: var(--chat-secondary); }
.help-form textarea { field-sizing: content; width: 100%; min-height: 36px; max-height: 104px; resize: none; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--chat-text); font: inherit; }
.help-form textarea:focus { outline: none; }
.help-form textarea::placeholder { color: var(--chat-secondary); }
.help-send { display: grid; place-items: center; padding: 0; width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--chat-accent); color: var(--chat-accent-ink); }
.help-send:disabled { opacity: .55; cursor: wait; }
.help-account-note { padding: 8px 16px 12px; }
.help-account-note a { color: var(--chat-secondary); font-size: 12px; }
.help-variants { flex-shrink: 0; display: flex; gap: 4px; padding: 6px 16px; border-bottom: 1px solid var(--chat-line); }
.help-variants button { border: 0; border-radius: 6px; background: transparent; color: var(--chat-secondary); padding: 4px 8px; font-size: 12px; }
.help-variants button[aria-pressed="true"] { background: var(--chat-raised); color: var(--chat-text); }

.help-dialog[data-style="console"] { --chat-surface: #111519; --chat-raised: #1c252d; --chat-user: #19212a; --chat-line: #35404b; --chat-accent: #c9e0f0; --chat-secondary: #aebcc7; border-radius: 12px; }
.help-dialog[data-style="console"] .help-messages { gap: 0; }
.help-dialog[data-style="console"] .help-message { align-self: stretch; max-width: none; background: transparent; border-radius: 0; border-bottom: 1px solid var(--chat-line); padding: 12px 4px; }
.help-dialog[data-style="console"] .help-message::before { content: attr(data-speaker); display: block; margin: 0 0 4px; color: var(--chat-accent); font-size: 12px; font-weight: 650; }
.help-dialog[data-style="console"] .question { color: #d6dee4; }
.help-dialog[data-style="console"] .question::before { color: var(--chat-secondary); }
.help-dialog[data-style="console"] .waiting { display: grid; grid-template-columns: auto 1fr; }
.help-dialog[data-style="console"] .waiting::before { grid-column: 1 / -1; }

.help-dialog[data-style="paper"] { --chat-surface: #f7f5ef; --chat-raised: #ece9e1; --chat-user: #dce9e1; --chat-line: #b9c4be; --chat-accent: #184f41; --chat-accent-ink: #f6fffa; --chat-text: #22352f; --chat-secondary: #455d54; color-scheme: light; font-size: 15px; }
.help-dialog[data-style="paper"] header { background: #ecefe8; }
.help-dialog[data-style="paper"] .help-message.reply { padding-inline: 0; background: transparent; }
.help-dialog[data-style="paper"] .help-message.question { border-radius: 12px 12px 3px 12px; }
.help-dialog[data-style="paper"] .help-message.reply::before { content: ''; width: 14px; height: 1px; margin: 0 0 6px; display: block; background: var(--chat-accent); }
.help-dialog[data-style="paper"] .help-message.waiting::before { display: none; }
.help-dialog[data-style="paper"] :focus-visible { outline-color: var(--chat-accent); }
.auth-optional { margin-left: 4px; color: var(--muted); font-size: .8rem; }

@media (max-width: 520px) {
  .help-dialog { height: min(504px, calc(100dvh - 108px)); }
  .help-dialog header { min-height: 52px; padding-block: 8px; }
  .help-messages { padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .help-wait-mark i { animation: none; }
}
.help-case-result button,.help-case-rating button{font:inherit;cursor:pointer}
.help-case-end{margin-left:auto;white-space:nowrap;padding:6px 9px;border:1px solid currentColor;border-radius:7px;font-size:.82rem}
.help-form[hidden]{display:none}
.help-case-identity{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:8px;font-size:.76rem}
.help-case-avatar{width:26px;height:26px;border-radius:50%}
.help-case-code{opacity:.75}
.help-case-closeout{border-top:1px solid color-mix(in srgb,currentColor 17%,transparent);padding:9px 0;margin-top:8px;color:var(--muted);font-size:.82rem}
.help-case-result{display:flex;align-items:center;justify-content:space-between;gap:8px}
.help-case-rating{display:grid;gap:8px;margin-top:9px}
.help-case-feedback:not([hidden]){display:grid;gap:7px}
.help-case-rating textarea{width:100%;font:inherit;color:inherit;background:transparent;border:1px solid color-mix(in srgb,currentColor 32%,transparent);border-radius:6px;padding:7px}
.help-case-rating button,.help-case-result button{padding:6px 9px;border:1px solid color-mix(in srgb,currentColor 32%,transparent);border-radius:6px;color:inherit;background:transparent}
.help-case-rating button[type=submit]{justify-self:end}
.help-case-rating button:disabled{opacity:.55;cursor:default}
.help-case-stars{display:flex;gap:5px}
.help-case-stars .selected{color:#ca8d35;border-color:currentColor}
.help-case-error:empty{display:none}
