.support-widget { position: fixed; right: max(22px, env(safe-area-inset-right)); bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--support-keyboard-offset, 0px)); z-index: 70; font-family: inherit; }
.support-widget [hidden], .support-inbox [hidden] { display: none !important; }
.support-widget svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.support-launcher { width: 58px; height: 58px; display: grid; place-items: center; border: 0; border-radius: 20px 20px 8px 20px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.support-launcher > svg { width: 32px; height: 32px; stroke-width: 1.6; }
.support-launcher-unread { position: absolute; right: 0; bottom: 65px; width: max-content; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); color: var(--text); font-size: .75rem; }
.support-panel { position: absolute; bottom: 74px; right: 0; width: min(388px, calc(100vw - 32px)); height: min(620px, calc(var(--support-viewport-height, 100dvh) - 118px)); min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.support-panel:not([hidden]) { animation: support-enter .2s cubic-bezier(.16, 1, .3, 1); }
@keyframes support-enter { from { transform: translateY(8px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.support-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 16px; gap: 12px; }
.support-header h2 { margin: 0; font-size: 1.125rem; line-height: 1.4; letter-spacing: -.025em; font-weight: 700; }
.support-header p { margin: 4px 0 0; color: var(--muted); font-size: .8125rem; }
.support-icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.support-tabs { display: grid; grid-template-columns: .85fr 1.3fr; margin: 0 16px; padding: 4px; gap: 4px; border-radius: 8px; background: var(--surface-soft); }
.support-tabs button { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .8125rem; font-weight: 650; cursor: pointer; }
.support-tabs button[aria-selected="true"] { background: var(--surface-raised); color: var(--text); }
.support-tabs svg { width: 18px; height: 18px; }
.support-tab-unread { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.support-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.support-thread-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px 0; }
.support-history-picker { position: relative; flex: 1 1 auto; min-width: 0; max-width: 74%; }
.support-history-trigger { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-soft); color: var(--text); text-align: left; cursor: pointer; }
.support-history-copy { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.support-history-kicker { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .055em; line-height: 1.25; text-transform: uppercase; }
.support-history-current { overflow: hidden; color: var(--text); font-size: .75rem; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.support-history-meta { overflow: hidden; color: var(--muted); font-size: .75rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.support-history-chevron { width: 18px !important; height: 18px !important; color: var(--muted); transition: transform .16s ease, color .16s ease; }
.support-history-trigger[aria-expanded="true"] { border-color: var(--accent); }
.support-history-trigger[aria-expanded="true"] .support-history-chevron { transform: rotate(180deg); color: var(--text); }
.support-history-menu { position: absolute; z-index: 5; top: calc(100% + 7px); left: 0; box-sizing: border-box; width: max(100%, min(320px, calc(100vw - 96px))); max-height: min(260px, 42vh); overflow: auto; padding: 5px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.support-history-option { width: 100%; min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.support-history-option[aria-selected="true"] { border-color: #e45c6238; background: var(--pro-surface); }
.support-history-option-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 2px; }
.support-history-option-title { overflow: hidden; font-size: .75rem; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.support-history-option-meta { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.support-history-option-symbol, .support-history-option-check { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--muted); }
.support-history-option-symbol { border-color: transparent; background: var(--surface-soft); color: var(--text); }
.support-history-option-check { width: 22px; height: 22px; flex-basis: 22px; border-color: transparent; color: transparent; }
.support-history-option[aria-selected="true"] .support-history-option-check { color: var(--accent); }
.support-history-option svg { width: 16px !important; height: 16px !important; stroke-width: 2; }
.support-text-button { min-height: 44px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); color: var(--text); font: inherit; font-size: .75rem; font-weight: 650; cursor: pointer; white-space: nowrap; }
.support-text-button svg { width: 16px; height: 16px; }
.support-history-trigger:focus-visible, .support-history-option:focus-visible, .support-text-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.support-history-trigger:disabled, .support-text-button:disabled { opacity: .5; cursor: not-allowed; }
.support-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.support-welcome { margin: auto 0; padding: 14px 0; }
.support-welcome h3 { margin: 0 0 8px; font-size: 1.125rem; line-height: 1.45; letter-spacing: -.02em; }
.support-welcome p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.65; }
.support-suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 20px; }
.support-suggestions button { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: .8125rem; text-align: left; cursor: pointer; }
.support-message { max-width: 94%; margin: 0 0 16px; }
.support-message[data-role="user"] { margin-left: auto; }
.support-message header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; color: var(--muted); font-size: .75rem; }
.support-message[data-role="user"] header { justify-content: flex-end; }
.support-message p { margin: 0; padding: 12px 14px; border-radius: 12px 12px 12px 3px; background: var(--surface-raised); color: var(--text); font-size: .875rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-message[data-role="user"] p { width: fit-content; max-width: 100%; margin-left: auto; border-radius: 12px 12px 3px 12px; background: var(--pro-surface); }
.support-notice { margin: 0; padding: 0 18px 10px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.support-notice:empty { display: none; }
.support-notice.is-error { color: var(--danger); }
.support-compose { flex-shrink: 0; margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.support-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.support-compose textarea { width: 100%; resize: none; min-height: 66px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-soft); color: var(--text); font: inherit; font-size: 1rem; line-height: 1.45; caret-color: var(--accent); }
.support-compose-row > button { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.support-compose button:disabled { opacity: .45; cursor: default; }
.support-compose > p { margin: 8px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.support-email-label { display: block; margin-bottom: 10px; color: var(--text); font-size: .75rem; }
.support-email-label span { color: var(--muted); }
.support-email-label input { display: block; width: 100%; height: 42px; min-height: 42px; margin-top: 6px; font-size: 1rem; }
.support-widget:has(~ dialog[open]), body:has(dialog[open]) .support-widget { visibility: hidden; }
@media (hover: hover) {
  .support-launcher:hover, .support-compose-row > button:hover:not(:disabled) { background: var(--accent-hover); }
  .support-icon-button:hover, .support-tabs button:hover, .support-suggestions button:hover, .support-history-option:hover:not([aria-selected="true"]) { background: var(--surface-raised); color: var(--text); }
  .support-history-trigger:hover:not(:disabled), .support-text-button:hover:not(:disabled) { border-color: var(--accent); }
}
@media (max-width: 650px) {
  .support-widget { left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--support-keyboard-offset, 0px)); pointer-events: none; }
  .support-launcher { width: 52px; height: 52px; margin-left: auto; border-radius: 18px 18px 7px 18px; pointer-events: auto; }
  .support-panel { width: 100%; max-width: 388px; bottom: 66px; height: min(590px, calc(var(--support-viewport-height, 100dvh) - 98px)); pointer-events: auto; }
  .support-header { padding: 14px 16px 12px; }
}
@media (prefers-reduced-motion: reduce) { .support-panel:not([hidden]) { animation: none; } }
@media (max-width: 380px) {
  .support-tabs svg { display: none; }
  .support-text-button { width: 44px; padding: 0; font-size: 0; }
}
@media (max-height: 600px) {
  .support-header { padding: 8px 12px; }
  .support-header p { display: none; }
  .support-thread-tools { padding-top: 6px; flex-shrink: 0; }
  .support-content { overflow-y: auto; overscroll-behavior: contain; }
  .support-compose { padding: 8px 12px; }
  .support-email-label { margin-bottom: 6px; }
  .support-email-label input { min-height: 38px; height: 38px; }
}
