/* KI-Assistent (Header-Button + Overlay). Eigenständig, keine Build-Pipeline nötig. */
.pb-header__ai-button {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-left: .4rem;
    padding: 0 .75rem;
    min-height: 42px;
    border: 1px solid var(--pb-color-primary, #1a57c8);
    border-radius: 8px;
    background: #fff;
    color: var(--pb-color-primary, #1a57c8);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}
.pb-header__ai-button:hover,
.pb-header__ai-button[aria-expanded="true"] {
    background: var(--pb-color-primary, #1a57c8);
    color: #fff;
    box-shadow: 0 6px 14px rgba(20, 71, 163, .18);
}
.pb-header__ai-button:focus-visible { outline: 3px solid rgba(26, 87, 200, .35); outline-offset: 2px; }
@media (max-width: 575.98px) { .pb-header__ai-label { display: none; } .pb-header__ai-button { padding: 0 .6rem; } }

.ps-ai-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1990;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(1px);
}
.ps-ai-panel {
    position: fixed;
    z-index: 2000;
    left: 50%;
    transform: translateX(-50%);
    width: min(920px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    overflow: hidden;
    font-size: 15px;
    color: #111827;
}
.ps-ai-panel[hidden], .ps-ai-backdrop[hidden] { display: none; }
.ps-ai-head { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid #e5e7eb; }
.ps-ai-head__title { font-weight: 700; }
.ps-ai-head__beta { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #1a57c8; background: #e8f0fe; border-radius: 999px; padding: .1rem .5rem; }
.ps-ai-head__spacer { flex: 1; }
.ps-ai-head button { border: 0; background: none; color: #4b5563; cursor: pointer; padding: .3rem .5rem; border-radius: 6px; font-size: 14px; }
.ps-ai-head button:hover { background: #f3f4f6; color: #111827; }

.ps-ai-form { display: flex; gap: .5rem; padding: .8rem 1rem; border-bottom: 1px solid #e5e7eb; background: #f9fafb; }
.ps-ai-form textarea {
    flex: 1;
    resize: none;
    min-height: 46px;
    max-height: 120px;
    padding: .65rem .8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    line-height: 1.4;
}
.ps-ai-form textarea:focus { outline: none; border-color: #1a57c8; box-shadow: 0 0 0 3px rgba(26, 87, 200, .15); }
.ps-ai-form button { min-width: 92px; border: 0; border-radius: 8px; background: #1a57c8; color: #fff; font-weight: 700; cursor: pointer; }
.ps-ai-form button:disabled { opacity: .6; cursor: progress; }

.ps-ai-thread { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .9rem; }
.ps-ai-msg { max-width: 100%; }
.ps-ai-msg--user { align-self: flex-end; max-width: 80%; background: #1a57c8; color: #fff; border-radius: 12px 12px 2px 12px; padding: .55rem .8rem; white-space: pre-wrap; }
.ps-ai-msg--bot .ps-ai-msg__text { background: #f3f4f6; border-radius: 12px 12px 12px 2px; padding: .6rem .85rem; display: inline-block; max-width: 90%; }
.ps-ai-msg--thinking .ps-ai-msg__text { color: #6b7280; font-style: italic; }
.ps-ai-msg--error .ps-ai-msg__text { background: #fef2f2; color: #991b1b; }
.ps-ai-examples { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.ps-ai-examples button { border: 1px solid #c7d7f5; background: #fff; color: #1a57c8; border-radius: 999px; padding: .3rem .75rem; cursor: pointer; font-size: 14px; }
.ps-ai-examples button:hover { background: #e8f0fe; }

.ps-ai-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin-top: .6rem; }
.ps-ai-item { display: flex; gap: .6rem; align-items: center; padding: .55rem; border: 1px solid #e5e7eb; border-radius: 10px; text-decoration: none; color: inherit; background: #fff; transition: border-color .15s, box-shadow .15s; }
.ps-ai-item:hover { border-color: #9fb8e3; box-shadow: 0 6px 14px rgba(20, 71, 163, .1); }
.ps-ai-item__img { flex: 0 0 48px; width: 48px; height: 48px; object-fit: contain; background: #f9fafb; border-radius: 6px; }
.ps-ai-item__body { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ps-ai-item__name { font-size: 14px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ps-ai-item__code { font-size: 12px; color: #6b7280; }
.ps-ai-item__price { font-size: 13px; font-weight: 700; color: #111827; }
.ps-ai-more { display: inline-block; margin-top: .6rem; color: #1a57c8; font-weight: 600; }

body.ps-ai-open { overflow: hidden; }
@media (max-width: 575.98px) {
    .ps-ai-panel { width: calc(100vw - 12px); border-radius: 10px; }
    .ps-ai-items { grid-template-columns: 1fr; }
}

