/* Public chat widget - spec 9 */
#tn911-public-chat-root { --chat-primary: #2563eb; --chat-bg: #fff; --chat-border: #e2e8f0; --chat-text: #1e293b; }
.tn911-pcw { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; font-size: 14px; }
.tn911-pcw-bubble { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--chat-primary); color: #fff; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(37,99,235,.4); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.tn911-pcw-bubble:hover { transform: scale(1.05); }
.tn911-pcw-panel { position: fixed; bottom: 90px; right: 24px; width: 380px; max-width: calc(100vw - 48px); height: 480px; max-height: calc(100vh - 140px); background: var(--chat-bg); border: 1px solid var(--chat-border); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.15); z-index: 9999; display: flex; flex-direction: column; overflow: hidden; }
.tn911-pcw-panel[aria-hidden="true"] { display: none; }
.tn911-pcw-header { padding: 14px 16px; background: var(--chat-primary); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.tn911-pcw-close { background: transparent; border: none; color: inherit; cursor: pointer; padding: 4px; }
.tn911-pcw-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tn911-pcw-msg { padding: 10px 12px; border-radius: 10px; max-width: 85%; }
.tn911-pcw-msg-guest { background: #f1f5f9; align-self: flex-end; }
.tn911-pcw-msg-ai, .tn911-pcw-msg-admin { background: #eff6ff; align-self: flex-start; }
.tn911-pcw-msg-cite { font-size: 11px; margin-top: 6px; color: #64748b; }
.tn911-pcw-notice { padding: 10px 12px; font-size: 12px; color: #64748b; background: #f8fafc; border-radius: 8px; margin: 8px 12px; }
.tn911-pcw-form { padding: 12px; border-top: 1px solid var(--chat-border); }
.tn911-pcw-input { width: 100%; padding: 10px 12px; border: 1px solid var(--chat-border); border-radius: 8px; resize: none; font-size: 14px; }
.tn911-pcw-continue { display: block; width: 100%; padding: 10px; margin-top: 8px; background: var(--chat-primary); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; text-align: center; }
.tn911-pcw-continue:hover { opacity: .95; }
/* AI job cards */
.tn911-pcw-jobs { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tn911-pcw-job { border: 1px solid var(--chat-border); border-radius: 8px; padding: 8px 10px; background: #fff; }
.tn911-pcw-job-title { font-weight: 600; color: var(--chat-text); }
.tn911-pcw-job-meta { font-size: 12px; color: #475569; margin-top: 2px; }
.tn911-pcw-job-pay { font-size: 13px; color: #047857; font-weight: 600; margin-top: 2px; }
.tn911-pcw-job-shift { font-size: 12px; color: #475569; }
.tn911-pcw-job-link { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--chat-primary); text-decoration: none; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }
.tn911-pcw-job-link:hover { text-decoration: underline; }

/* External job leave modal (chat widget) */
.tn911-pcw-ext-modal { --chat-primary: #2563eb; --chat-text: #1e293b; --chat-border: #e2e8f0; position: fixed; inset: 0; z-index: 10050; display: none; align-items: center; justify-content: center; padding: 16px; }
.tn911-pcw-ext-modal.tn911-pcw-ext-modal-open { display: flex; }
.tn911-pcw-ext-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.tn911-pcw-ext-modal-dialog { position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.2); overflow: hidden; }
.tn911-pcw-ext-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--chat-border); }
.tn911-pcw-ext-modal-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--chat-text); }
.tn911-pcw-ext-modal-close { background: transparent; border: none; font-size: 22px; line-height: 1; color: #64748b; cursor: pointer; padding: 0 4px; }
.tn911-pcw-ext-modal-body { padding: 16px; font-size: 14px; color: #475569; }
.tn911-pcw-ext-modal-body p { margin: 0; }
.tn911-pcw-ext-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 16px; }
.tn911-pcw-ext-btn { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.tn911-pcw-ext-btn-secondary { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.tn911-pcw-ext-btn-primary { background: #2563eb; background: var(--chat-primary, #2563eb); color: #fff; }

/* Typing indicator */
.tn911-pcw-typing .tn911-pcw-dots { display: inline-flex; gap: 4px; align-items: center; }
.tn911-pcw-dots span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; display: inline-block; animation: tn911-pcw-blink 1.2s infinite both; }
.tn911-pcw-dots span:nth-child(2) { animation-delay: .2s; }
.tn911-pcw-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes tn911-pcw-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Dedicated /ai page */
.tn911-aipage { padding: 32px 16px 64px; }
.tn911-aipage-inner { max-width: 760px; margin: 0 auto; }
.tn911-aipage-head { text-align: center; margin-bottom: 20px; }
.tn911-aipage-title { font-size: 28px; font-weight: 700; margin: 0 0 8px; color: #0f172a; }
.tn911-aipage-subtitle { color: #475569; margin: 0; }
#tn911-ai-page { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.06); overflow: hidden; }
.tn911-aipage-messages { min-height: 360px; max-height: 60vh; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tn911-aipage-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e2e8f0; }
.tn911-aipage-input { flex: 1; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px; resize: none; font-size: 15px; }
.tn911-aipage-send { padding: 0 18px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.tn911-aipage-send:hover { opacity: .95; }
.tn911-aipage-note { font-size: 12px; color: #94a3b8; padding: 0 12px 12px; margin: 0; }

@media (max-width: 480px) { .tn911-pcw-panel { bottom: 0; right: 0; left: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; } }
