.wcaf-widget { font-family: inherit; }
.wcaf-widget [hidden] { display: none !important; }
.wcaf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wcaf-widget .wcaf-dialog {
    position: fixed; inset: 0; margin: auto; padding: 0; box-sizing: border-box;
    width: min(720px, calc(100% - 32px)); height: min(650px, calc(100% - 36px));
    max-width: none; max-height: none; overflow: hidden; border: 1px solid #e8e8e8;
    border-radius: 24px; background: #fff; color: #171717; box-shadow: 0 28px 90px #0003;
    font: inherit; line-height: 1.7;
}
.wcaf-widget .wcaf-dialog[open] { display: flex; flex-direction: column; }
.wcaf-dialog::backdrop { background: #17171765; }
.wcaf-dialog header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.15rem; border-bottom: 1px solid #f0f0f0; }
.wcaf-brand { display: flex; align-items: center; gap: .6rem; }
.wcaf-brand > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--wcaf-color); color: #fff; }
.wcaf-widget .wcaf-dialog button { display: grid; place-items: center; border: 0; cursor: pointer; padding: 0; min-height: 36px; min-width: 36px; width: 36px; border-radius: 50%; font: inherit; line-height: 1; }
.wcaf-widget .wcaf-dialog .wcaf-close { color: #343434; background: #f4f4f4; font-size: 1.4rem; }
.wcaf-dialog .wcaf-log { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 1.4rem clamp(16px, 5vw, 48px); }
.wcaf-dialog .wcaf-log p { margin: 0 0 1.1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.wcaf-dialog .wcaf-log .wcaf-user { margin-inline-start: auto; width: fit-content; max-width: 82%; padding: .6rem .95rem; border-radius: 18px; background: #f2f2f2; }
.wcaf-dialog .wcaf-thinking { display: flex; gap: 5px; align-items: center; min-height: 30px; }
.wcaf-thinking i { width: 6px; height: 6px; border-radius: 50%; background: #595959; animation: wcaf-dot 1.1s infinite alternate; }
.wcaf-thinking i:nth-of-type(2) { animation-delay: .15s; }
.wcaf-thinking i:nth-of-type(3) { animation-delay: .3s; }
@keyframes wcaf-dot { from { opacity: .3; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wcaf-thinking i { animation: none; } }
.wcaf-dialog form { padding: .65rem .9rem .35rem; margin: 0 clamp(12px, 4vw, 38px) 1rem; border: 1px solid #e2e2e2; border-radius: 22px; box-shadow: 0 2px 8px #0000000a; }
.wcaf-dialog .wcaf-input-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wcaf-widget .wcaf-dialog textarea { display: block; width: 100%; min-height: 46px; max-height: 100px; box-sizing: border-box; resize: vertical; border: 0; padding: .35rem; margin: 0; background: transparent; color: inherit; font: inherit; box-shadow: none; }
.wcaf-dialog .wcaf-actions { display: flex; align-items: center; gap: .5rem; }
.wcaf-widget .wcaf-dialog button[type=submit] { margin-inline-start: auto; color: #fff; background: #202020; font-size: 1.45rem; }
.wcaf-dialog .wcaf-photo { position: relative; display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 50%; background: #f4f4f4; cursor: pointer; font-size: 1.3rem; }
.wcaf-dialog input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.wcaf-dialog .wcaf-file { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .75rem; }
.wcaf-dialog small { display: block; margin-top: .35rem; color: #606060; font-size: .75rem; }
.wcaf-dialog .wcaf-product { display: flex; align-items: center; gap: .7rem; padding: .65rem; margin: .45rem 0; border: 1px solid #eaeaea; border-radius: 14px; color: inherit; text-decoration: none; }
.wcaf-dialog .wcaf-product:hover { background: #f8f8f8; }
.wcaf-dialog .wcaf-product img { flex: 0 0 52px; width: 52px; height: 52px; object-fit: contain; border-radius: 8px; }
.wcaf-widget :focus-visible, .wcaf-photo:focus-within { outline: 2px solid var(--wcaf-color); outline-offset: 2px; }
.wcaf-widget button:disabled { opacity: .45; cursor: wait; }
@media (max-width: 600px) {
    .wcaf-widget .wcaf-dialog { inset: auto 0 0; margin: 0; width: 100%; height: min(760px, 88dvh); border-radius: 22px 22px 0 0; }
    .wcaf-dialog form { margin-bottom: calc(.75rem + env(safe-area-inset-bottom)); }
    .wcaf-widget .wcaf-dialog textarea { font-size: 16px; }
}
.wcaf-dialog .wcaf-choices { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.15rem; }
.wcaf-widget .wcaf-dialog .wcaf-choices button {
    display: inline-flex; width: auto; min-height: 38px; padding: .45rem .8rem; border: 1px solid #e6e6e6;
    border-radius: 12px; color: #292929; background: #fff; font-size: .86rem; line-height: 1.5;
}
.wcaf-widget .wcaf-dialog .wcaf-choices button:hover { border-color: var(--wcaf-color); color: var(--wcaf-color); }
