/* Pendict support chat widget */
.sw-root { position: fixed; right: 18px; bottom: 18px; z-index: 1100; font-family: inherit; }
.sw-launcher { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; background: var(--orange); color: var(--on-orange); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(15, 34, 71, .35); transition: transform .15s ease-out, box-shadow .15s ease-out; }
.sw-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 34, 71, .42); }
.sw-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #dc2626; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.sw-badge[hidden], .sw-panel[hidden], .sw-typing[hidden], .sw-error[hidden], .sw-start[hidden], .sw-thread[hidden], .sw-composer[hidden], .sw-icon-btn[hidden] { display: none; }
.sw-panel { position: absolute; right: 0; bottom: 74px; width: min(380px, calc(100vw - 24px)); height: min(600px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--border-dark); border-radius: 18px; box-shadow: 0 20px 60px rgba(8, 15, 30, .35); overflow: hidden; }
.sw-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--brand-navy); color: #fff; }
.sw-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--orange); color: var(--on-orange); font-weight: 800; display: grid; place-items: center; flex: none; }
.sw-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sw-title strong { font-size: 15px; }
.sw-status { font-size: 12px; color: rgba(255,255,255,.8); display: flex; align-items: center; gap: 6px; }
.sw-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; display: inline-block; }
.sw-status.online .sw-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.sw-icon-btn { background: transparent; border: 0; color: #fff; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.sw-icon-btn:hover { background: rgba(255,255,255,.14); }
.sw-icon-btn.copied { color: #86efac; }
.sw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.sw-start { padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.sw-start label { font-size: 13px; font-weight: 600; margin-top: 6px; }
.sw-opt { font-weight: 400; color: var(--text-muted); }
.sw-intro { font-size: 13.5px; color: var(--text-muted); margin: 0 0 4px; line-height: 1.5; }
.sw-start input, .sw-start textarea, .sw-composer textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-dark); border-radius: 10px; padding: 10px 12px; width: 100%; box-sizing: border-box; resize: vertical; }
.sw-start input:focus, .sw-start textarea:focus, .sw-composer textarea:focus { outline: 3px solid var(--orange-text); outline-offset: 1px; }
.sw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sw-primary { margin-top: 10px; min-height: 44px; border: 0; border-radius: 12px; background: var(--orange); color: var(--on-orange); font: inherit; font-weight: 700; cursor: pointer; }
.sw-primary:disabled { opacity: .6; cursor: wait; }
.sw-legal { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; line-height: 1.45; }
.sw-legal a { color: var(--orange-text); text-decoration: underline; }
.sw-error { color: #b91c1c; font-size: 13px; margin: 4px 0 0; }
.sw-field-error { color: #b91c1c; font-size: 12.5px; font-weight: 600; margin: 2px 0 0; }
.sw-field-error[hidden], .sw-hint[hidden] { display: none; }
.sw-start input[aria-invalid="true"] { border-color: #b91c1c; }
[data-theme="dark"] .sw-field-error { color: #fca5a5; }
.sw-how { background: var(--surface); border: 1px solid var(--border-dark); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--text); margin: 0 0 6px; }
.sw-how ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-muted); list-style: disc; }
.sw-start > * { flex-shrink: 0; }
.sw-start textarea { min-height: 92px; }
.sw-how li + li { margin-top: 4px; }
.sw-hint { margin: 10px 12px 0; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; background: var(--surface); border: 1px solid var(--border-dark); color: var(--text-muted); }
.sw-hint strong { color: var(--text); font-weight: 700; }
.sw-hint.away { border-color: #d97706; }
.sw-hint.closed { border-color: var(--text-muted); border-width: 2px; background: var(--surface-2); }
.sw-hint-btn { display: block; margin: 8px 0 0; font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px; min-height: 32px; border-radius: 8px; border: 2px solid var(--text); background: transparent; color: var(--text); cursor: pointer; }
.sw-hint.closed .sw-hint-btn { background: var(--orange); border-color: var(--orange); color: #0F2247; }
.sw-status.closed .sw-dot { background: #f87171; }
.sw-thread.sw-closed { opacity: .85; }
[data-theme="dark"] .sw-error { color: #fca5a5; }
.sw-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.sw-msg { display: flex; flex-direction: column; max-width: 86%; }
.sw-visitor { align-self: flex-end; align-items: flex-end; }
.sw-admin { align-self: flex-start; align-items: flex-start; }
.sw-system { align-self: center; max-width: 94%; }
.sw-who { font-size: 11px; font-weight: 700; color: var(--text-muted); margin: 0 0 3px 6px; }
.sw-bubble { padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.sw-visitor .sw-bubble { background: var(--brand-navy); color: #fff; border-bottom-right-radius: 5px; }
.sw-admin .sw-bubble { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.sw-system .sw-bubble { background: transparent; color: var(--text-muted); font-size: 12.5px; text-align: center; padding: 2px 8px; }
.sw-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sw-meta, .sw-seen { font-size: 11px; color: var(--text-muted); margin: 3px 6px 0; }
.sw-seen { margin-top: 0; }
.sw-typing { padding: 0 16px 8px; font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.sw-composer { padding: 10px 12px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.sw-row { display: flex; gap: 8px; align-items: flex-end; }
.sw-composer textarea { resize: none; max-height: 120px; min-height: 42px; }
.sw-send { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--orange); color: var(--on-orange); cursor: pointer; display: grid; place-items: center; }
.sw-send:disabled { opacity: .55; cursor: wait; }
.sw-foot { font-size: 11.5px; color: var(--text-muted); margin: 8px 2px 0; }
@media (max-width: 520px) {
  .sw-root { right: 12px; bottom: 12px; }
  body.sw-open .sw-launcher { display: none; }
  .sw-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
  .sw-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .sw-composer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .sw-launcher, .sw-thread { transition: none; scroll-behavior: auto; } }

/* iOS zooms into any field whose text is smaller than 16px */
@media (pointer: coarse) { .sw-start input, .sw-start textarea, .sw-composer textarea { font-size: 16px; } }
