.faq-widget {
    --faq-inset: max(16px, env(safe-area-inset-right));
    --faq-bottom: max(18px, env(safe-area-inset-bottom));
    position: fixed;
    z-index: 20;
    right: var(--faq-inset);
    bottom: var(--faq-bottom);
}
.faq-widget [hidden] { display: none !important; }
.faq-trigger {
    width: 76px;
    height: 76px;
    padding: 5px;
    position: relative;
    display: grid;
    place-items: center;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 50%;
    box-shadow: 3px 4px 0 var(--ink);
}
.faq-trigger img { width: 100%; height: 100%; object-fit: contain; }
.faq-trigger span {
    position: absolute; right: -2px; top: -4px;
    border: 2px solid var(--ink); border-radius: 50%;
    background: var(--orange); width: 25px; height: 25px;
    font: bold 17px/21px var(--mono);
}
.faq-trigger:hover { background: #ffeadc; }
#faq-panel {
    position: fixed; bottom: calc(var(--faq-bottom) + 90px); right: var(--faq-inset);
    width: min(365px, calc(100% - var(--faq-inset) - 14px));
    max-height: calc(100vh - 125px);
    max-height: calc(100dvh - 125px - env(safe-area-inset-bottom));
    background: var(--paper); border: 1.5px solid var(--ink);
    border-radius: 17px; box-shadow: 4px 5px 0 var(--ink);
    display: flex; flex-direction: column; overflow: hidden;
}
.faq-heading {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    background: #f4e5d4; border-bottom: 1px solid var(--ink);
}
.faq-heading img { object-fit: contain; }
.faq-heading h2 { font-size: 1.25rem; letter-spacing: -.04em; }
.faq-close { margin-left: auto; border: 0; background: transparent; font: 28px/1 Arial; width: 42px; height: 42px; }
.faq-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; line-height: 1.45; }
#faq-welcome { margin-bottom: 12px; }
#faq-options { display: grid; gap: 6px; }
#faq-options button, #faq-again {
    border: 1px solid #969789; border-radius: 10px;
    padding: 9px 12px; text-align: left; background: #fffef8;
    color: var(--ink); font: 600 .91rem/1.4 Arial, sans-serif;
}
#faq-options button:hover, #faq-again:hover { background: #ffeadc; border-color: var(--ink); }
#faq-reply strong { display: block; font-size: 1rem; margin-bottom: 8px; overflow-wrap: anywhere; }
#faq-reply p { margin: 0 0 13px; padding: 10px 12px; background: #eeede2; border-left: 3px solid var(--orange); }
.faq-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.faq-form input { font: inherit; min-width: 0; width: 100%; padding: 10px; border: 1px solid #949589; border-radius: 8px; }
.faq-form button { border: 1px solid var(--ink); border-radius: 8px; background: var(--ink); color: var(--paper); font-weight: 700; padding: 8px 12px; }
body:has(.faq-widget) footer { padding-right: 92px; }
@media (max-width: 480px), (max-height: 520px) {
    .faq-trigger { width: 60px; height: 60px; }
    #faq-panel { bottom: calc(var(--faq-bottom) + 70px); max-height: calc(100dvh - 110px - env(safe-area-inset-bottom)); }
    .faq-heading { padding: 6px 10px; }
    .faq-heading img { width: 40px; height: 40px; }
    .faq-body { padding: 12px; }
}

