/* One Bridge AI Assistant widget. Every class is prefixed "obta-" so it cannot clash with page styles. */
.obta-root {
    --obta-ink: #13161c;
    --obta-muted: #5c6370;
    --obta-line: #e8e4dc;
    --obta-surface: #f9f6f0;
    --obta-dark: #0b0e13;
    --obta-dark-2: #171b22;
    --obta-gold: #f2a93b;
    --obta-gold-grad: linear-gradient(135deg, #f8c35c 0%, #f2a93b 55%, #e98a2b 100%);
    --obta-radius: 20px;
    position: fixed; right: 24px; bottom: 24px; z-index: 1080;
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    font-size: 15px; line-height: 1.5; color: var(--obta-ink);
}
.obta-root *, .obta-root *::before, .obta-root *::after { box-sizing: border-box; }
.obta-root[hidden] { display: none !important; }

/* Launcher */
.obta-launcher {
    position: relative; width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--obta-gold-grad); color: var(--obta-on-accent, #17120a);
    display: grid; place-items: center;
    box-shadow: 0 14px 34px -10px rgba(242, 169, 59, .75), 0 4px 12px rgba(0, 0, 0, .25);
    transition: transform .2s ease, box-shadow .2s ease;
}
.obta-launcher:hover { transform: translateY(-2px) scale(1.03); }
.obta-launcher:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--obta-gold); }
.obta-launcher svg { width: 28px; height: 28px; }
.obta-launcher .obta-close-icon { display: none; }
.obta-root.obta-open .obta-launcher .obta-chat-icon { display: none; }
.obta-root.obta-open .obta-launcher .obta-close-icon { display: block; }
.obta-pulse::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--obta-gold);
    animation: obta-pulse 2.4s ease-out infinite; pointer-events: none;
}
@keyframes obta-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.55); opacity: 0; } }

/* Teaser bubble */
.obta-teaser {
    position: absolute; right: 74px; bottom: 8px; width: max-content; max-width: 240px;
    background: #fff; color: var(--obta-ink); border-radius: 16px 16px 4px 16px; padding: 12px 34px 12px 14px;
    box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .35); font-size: 14px; font-weight: 600; cursor: pointer;
    animation: obta-rise .35s ease both;
}
.obta-teaser-close {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border: 0; border-radius: 50%;
    background: transparent; color: var(--obta-muted); cursor: pointer; font-size: 16px; line-height: 1;
}
.obta-teaser-close:hover { background: #f1eee8; }

/* Panel */
.obta-panel {
    position: absolute; right: 0; bottom: 78px; width: 390px; height: min(640px, calc(100vh - 120px));
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border-radius: var(--obta-radius);
    box-shadow: 0 30px 80px -20px rgba(11, 14, 19, .55), 0 0 0 1px rgba(11, 14, 19, .06);
    animation: obta-rise .25s ease both;
}
.obta-panel[hidden] { display: none; }
@keyframes obta-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.obta-header {
    display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; color: #fff;
    background: radial-gradient(ellipse 120% 160% at 100% 0%, #3a2c14 0%, var(--obta-dark-2) 55%, var(--obta-dark) 100%);
    border-bottom: 2px solid transparent; border-image: var(--obta-gold-grad) 1;
}
.obta-avatar {
    width: 40px; height: 40px; border-radius: 12px; flex: none; overflow: hidden;
    background: #1d222b; display: grid; place-items: center; border: 1px solid rgba(246, 185, 74, .45);
}
.obta-avatar img { width: 32px; height: 32px; object-fit: contain; }
.obta-title { flex: 1; min-width: 0; }
.obta-title strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obta-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #c8c2b6; }
.obta-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3ccf7e; box-shadow: 0 0 0 3px rgba(60, 207, 126, .2); }
.obta-icon-btn {
    width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: #e7e2d8;
    display: grid; place-items: center; cursor: pointer; flex: none;
}
.obta-icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.obta-icon-btn:focus-visible { outline: 2px solid var(--obta-gold); outline-offset: 1px; }
.obta-icon-btn svg { width: 18px; height: 18px; }

.obta-preview {
    background: #fff4dc; color: #6b4300; font-size: 12.5px; padding: 8px 14px; border-bottom: 1px solid #f3dfb2;
}

/* Messages */
.obta-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--obta-surface); scroll-behavior: smooth; }
.obta-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; }
.obta-msg-bot .obta-mini { width: 26px; height: 26px; border-radius: 8px; flex: none; background: var(--obta-dark); display: grid; place-items: center; }
.obta-msg-bot .obta-mini img { width: 20px; height: 20px; object-fit: contain; }
.obta-bubble {
    max-width: 84%; padding: 10px 14px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere;
}
.obta-msg-bot .obta-bubble { background: #fff; border: 1px solid var(--obta-line); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(17, 20, 26, .04); }
.obta-msg-user { justify-content: flex-end; }
.obta-msg-user .obta-bubble { background: var(--obta-dark-2); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.obta-bubble p { margin: 0 0 8px; }
.obta-bubble p:last-child, .obta-bubble ul:last-child, .obta-bubble ol:last-child { margin-bottom: 0; }
.obta-bubble ul, .obta-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.obta-bubble li { margin-bottom: 3px; }
.obta-bubble a { color: #9a5a00; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.obta-msg-user .obta-bubble a { color: #ffd98f; }
.obta-bubble strong { font-weight: 700; }
.obta-msg-error .obta-bubble { background: #fff1f0; border-color: #f3c7c3; color: #8a1f17; }

.obta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px 34px; }
.obta-chip {
    border: 1px solid #ecd2a2; background: #fff; color: #6b4300; font: inherit; font-size: 13px; font-weight: 600;
    padding: 7px 12px; border-radius: 999px; cursor: pointer; text-align: left; transition: background .15s, border-color .15s;
}
.obta-chip:hover { background: #fff4dc; border-color: var(--obta-gold); }
.obta-chip:focus-visible { outline: 2px solid var(--obta-gold); outline-offset: 2px; }

.obta-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.obta-typing span { width: 7px; height: 7px; border-radius: 50%; background: #c9b48a; animation: obta-bounce 1.2s infinite ease-in-out; }
.obta-typing span:nth-child(2) { animation-delay: .15s; }
.obta-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes obta-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

/* Lead form */
.obta-form { background: #fff; border: 1px solid var(--obta-line); border-radius: 16px; padding: 14px; margin: 0 0 12px 34px; }
.obta-form h3 { font-size: 14.5px; font-weight: 800; margin: 0 0 4px; }
.obta-form p.obta-form-sub { font-size: 13px; color: var(--obta-muted); margin: 0 0 10px; }
.obta-field { margin-bottom: 9px; }
.obta-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 3px; color: #2a2f38; }
.obta-field input, .obta-field select, .obta-field textarea {
    width: 100%; font: inherit; font-size: 14px; color: var(--obta-ink); background: #fff;
    border: 1px solid #d9d4ca; border-radius: 10px; padding: 8px 10px;
}
.obta-field textarea { resize: vertical; min-height: 70px; }
.obta-field input:focus, .obta-field select:focus, .obta-field textarea:focus { outline: none; border-color: var(--obta-gold); box-shadow: 0 0 0 3px rgba(242, 169, 59, .25); }
.obta-field .obta-err { display: block; color: #b42318; font-size: 12px; margin-top: 3px; }
.obta-field [aria-invalid="true"] { border-color: #e5484d; }
.obta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.obta-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--obta-muted); margin: 4px 0 10px; }
.obta-consent input { margin-top: 3px; accent-color: #e98a2b; }
.obta-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.obta-btn {
    border: 0; border-radius: 999px; font: inherit; font-weight: 700; font-size: 14px; padding: 9px 18px; cursor: pointer;
    background: var(--obta-gold-grad); color: var(--obta-on-accent, #17120a);
}
.obta-btn:disabled { opacity: .6; cursor: progress; }
.obta-btn:focus-visible { outline: 2px solid var(--obta-dark); outline-offset: 2px; }
.obta-link-btn { border: 0; background: none; font: inherit; font-size: 13px; color: var(--obta-muted); text-decoration: underline; cursor: pointer; margin-left: 8px; }

/* Composer */
.obta-composer { border-top: 1px solid var(--obta-line); background: #fff; padding: 10px 12px 8px; }
.obta-input-row { display: flex; align-items: flex-end; gap: 8px; background: #f5f2ec; border: 1px solid #e3ded4; border-radius: 16px; padding: 6px 6px 6px 12px; }
.obta-input-row:focus-within { border-color: var(--obta-gold); box-shadow: 0 0 0 3px rgba(242, 169, 59, .2); background: #fff; }
.obta-input {
    flex: 1; border: 0; background: transparent; resize: none; font: inherit; font-size: 14.5px; color: var(--obta-ink);
    max-height: 120px; min-height: 24px; padding: 6px 0; outline: none;
}
.obta-send {
    width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer; flex: none;
    background: var(--obta-gold-grad); color: var(--obta-on-accent, #17120a); display: grid; place-items: center;
}
.obta-send:disabled { background: #e3ded4; color: #9a948a; cursor: not-allowed; }
.obta-send svg { width: 18px; height: 18px; }
.obta-send:focus-visible { outline: 2px solid var(--obta-dark); outline-offset: 2px; }
.obta-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: #8a8478; padding: 6px 4px 0; }
.obta-foot a { color: #8a8478; }
.obta-count { font-variant-numeric: tabular-nums; }
.obta-count.obta-over { color: #b42318; font-weight: 700; }

.obta-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* Phones: the panel fills the screen */
@media (max-width: 575.98px) {
    .obta-root { right: 16px; bottom: 16px; }
    .obta-root.obta-open { inset: 0; right: 0; bottom: 0; }
    .obta-root.obta-open .obta-launcher { display: none; }
    .obta-panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; bottom: 0; }
    .obta-teaser { max-width: 200px; }
    .obta-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .obta-root *, .obta-root *::before, .obta-root *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Admin test page: the panel is embedded in the page instead of floating. */
.obta-root.obta-embedded { position: relative; right: auto; bottom: auto; z-index: 1; }
.obta-root.obta-embedded .obta-launcher, .obta-root.obta-embedded .obta-teaser { display: none; }
.obta-root.obta-embedded .obta-panel { position: relative; bottom: auto; width: 100%; max-width: 440px; height: 640px; animation: none; }

/* Client assistants: icon avatar when there is no logo, "Powered by" credit, and the client's brand colour (set by the widget). */
.obta-avatar-icon { display: grid; place-items: center; width: 100%; height: 100%; color: var(--obta-accent-on-dark, var(--obta-gold)); }
.obta-avatar-icon svg { width: 60%; height: 60%; }
.obta-mini .obta-avatar-icon svg { width: 16px; height: 16px; }
.obta-powered { white-space: nowrap; }
.obta-root.obta-branded .obta-avatar { border-color: var(--obta-accent-on-dark, var(--obta-gold)); }
.obta-root.obta-branded .obta-header { border-image: none; border-bottom-color: var(--obta-gold); }
.obta-root.obta-branded .obta-chip { border-color: var(--obta-gold); color: var(--obta-ink); }
.obta-root.obta-branded .obta-chip:hover { background: var(--obta-accent-soft); }
.obta-root.obta-branded .obta-bubble a { color: var(--obta-ink); text-decoration-color: var(--obta-gold); text-decoration-thickness: 2px; }
.obta-root.obta-branded .obta-launcher { box-shadow: 0 14px 34px -10px var(--obta-gold), 0 4px 12px rgba(0, 0, 0, .25); }
.obta-root.obta-branded .obta-input-row:focus-within,
.obta-root.obta-branded .obta-field input:focus, .obta-root.obta-branded .obta-field select:focus, .obta-root.obta-branded .obta-field textarea:focus { box-shadow: 0 0 0 3px var(--obta-accent-soft); }
.obta-root.obta-branded .obta-consent input { accent-color: var(--obta-gold); }
