.oac-widget {
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --oac-color: #2563eb;
}
.oac-widget.oac-position-bottom-right { right: 24px; }
.oac-widget.oac-position-bottom-left  { left: 24px; }

.oac-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--oac-color);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    transition: transform .15s ease;
}
.oac-toggle:hover { transform: scale(1.05); }
.oac-toggle .oac-icon { width: 26px; height: 26px; display: flex; }
.oac-toggle .oac-icon svg { width: 100%; height: 100%; }
.oac-toggle .oac-icon-close { display: none; font-size: 30px; line-height: 1; }
.oac-widget.oac-open .oac-icon-open  { display: none; }
.oac-widget.oac-open .oac-icon-close { display: flex; align-items: center; justify-content: center; }

.oac-panel {
    position: absolute;
    bottom: 76px;
    width: 340px;
    max-width: calc(100vw - 48px);
    height: 560px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* `display: flex` above would otherwise override the hidden attribute
   the script uses to close the panel. */
.oac-panel[hidden] { display: none; }
.oac-position-bottom-right .oac-panel { right: 0; }
.oac-position-bottom-left  .oac-panel { left: 0; }

.oac-header {
    background: var(--oac-color);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.oac-header-icon { width: 22px; height: 22px; display: flex; }
.oac-header-icon svg { width: 100%; height: 100%; }
.oac-header-name { font-weight: 600; flex: 1; }
.oac-panel-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    opacity: .85;
}
.oac-panel-close:hover { opacity: 1; }

.oac-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e2e4;
    background: #fff;
}
.oac-quick-actions:empty { display: none; padding: 0; border: none; }

.oac-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f7f8;
}
.oac-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}
.oac-msg-user {
    align-self: flex-end;
    background: var(--oac-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.oac-msg-assistant {
    align-self: flex-start;
    background: #fff;
    color: #1e1e1e;
    border: 1px solid #e2e2e4;
    border-bottom-left-radius: 4px;
}
.oac-msg-typing { opacity: .6; font-style: italic; }

.oac-form {
    display: flex;
    border-top: 1px solid #e2e2e4;
    padding: 10px;
    gap: 8px;
}
.oac-input {
    flex: 1;
    border: 1px solid #d7d7db;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
}
.oac-input:focus { border-color: var(--oac-color); }
.oac-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--oac-color);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}
.oac-send:disabled { opacity: .5; cursor: default; }

/* Quick actions added by core (add-ons style their own the same way). */
.oac-quick-action {
    border: 1px solid var(--oac-color);
    color: var(--oac-color);
    background: #fff;
    border-radius: 14px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.oac-quick-action:hover { background: var(--oac-color); color: #fff; }

/* Cards in the message list: hand-off offer, form, confirmation, status. */
.oac-card { max-width: 92%; white-space: normal; }
.oac-card p { margin: 0 0 8px; }
.oac-card-title { font-weight: 600; }
.oac-card-text { color: #50505a; font-size: 13px; }
.oac-card form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.oac-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: #3c3c43; }
.oac-field input,
.oac-field textarea {
    border: 1px solid #d7d7db;
    border-radius: 8px;
    padding: 7px 10px;
    font: 400 14px/1.35 inherit;
    font-family: inherit;
    color: #1e1e1e;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.oac-field textarea { resize: vertical; min-height: 64px; }
.oac-field input:focus,
.oac-field textarea:focus { outline: 2px solid var(--oac-color); outline-offset: 0; border-color: transparent; }
.oac-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.oac-card-note { font-size: 11px; color: #6b6b75; margin: 0; }
.oac-card-note a { color: inherit; }
.oac-card-error { margin: 0; padding: 6px 10px; border-radius: 8px; background: #fde8e8; color: #8a1c1c; font-size: 13px; }
.oac-card-error[hidden] { display: none; }
.oac-card-button {
    border: none;
    background: var(--oac-color);
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.oac-card-button:disabled { opacity: .6; cursor: default; }
.oac-reference {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f1f1f4;
    font-size: 12px;
    color: #50505a;
}
.oac-reference strong { font-size: 16px; letter-spacing: .06em; color: #1e1e1e; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 480px) {
    .oac-panel { width: calc(100vw - 24px); height: calc(100vh - 120px); }
    .oac-widget.oac-position-bottom-right, .oac-widget.oac-position-bottom-left { right: 12px; left: 12px; }
}

/* Product cards: up to three recommended products under a reply. */
.oac-products {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.oac-product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e2e4;
    border-radius: 12px;
}
.oac-product-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}
.oac-product-image {
    flex: none;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    background: #f0f0f2;
}
.oac-product-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    line-height: 1.3;
}
.oac-product-name {
    font-weight: 600;
    color: #1e1e1e;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.oac-product-link:hover .oac-product-name { text-decoration: underline; }
.oac-product-price { color: #444; }
.oac-product-price.is-sale { color: #b42318; font-weight: 600; }
.oac-product-stock { color: #6b6b70; font-size: 12px; }
.oac-product-action {
    flex: none;
    border: none;
    background: var(--oac-color);
    color: #fff;
    border-radius: 8px;
    padding: 7px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.oac-product-action:hover { filter: brightness(1.08); color: #fff; }
.oac-product-action[aria-disabled="true"] { opacity: .6; cursor: default; }
.oac-product-action.is-added { background: #fff; color: var(--oac-color); box-shadow: inset 0 0 0 1px var(--oac-color); }
