/* Pricepep chat widget: pricepep.com's tokens (site.css), scoped to .ppc so it looks the same in the demo and in
   wp-admin. Contrast (WCAG AA, 4.5:1 or more for text): ink #14161B and muted #50555F on white; white on ink; white on
   the site's green #0E7C5A (5.2:1, its success icons' green), which keeps the button visible on the page (5.0:1 on
   #FAFAF7) and on the black footer (3.5:1 on #14161B; 3:1 asked for controls). Focus rings are ink, not red (red reads
   as an error), with a white ring around the button so it shows on the footer too. */
.ppc {
    --ppc-ink: #14161B;
    --ppc-muted: #50555F;
    --ppc-line: #E3E3DE;
    --ppc-ground: #FAFAF7;
    --ppc-surface: #FFFFFF;
    --ppc-chip: #EDEDE8;
    --ppc-green: #0E7C5A;
    --ppc-green-dark: #0B6A4C;
    --ppc-accent-ink: #A8231F;
    --ppc-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    font: 400 15px/1.5 var(--ppc-font);
    color: var(--ppc-ink);
    -webkit-font-smoothing: antialiased;
}
.ppc *, .ppc *::before, .ppc *::after { box-sizing: border-box; }
.ppc [hidden] { display: none !important; }
/* Zero specificity (:where), so the widget's own classes below always win over this reset */
:where(.ppc) button, :where(.ppc) textarea { font: inherit; color: inherit; margin: 0; }
.ppc :focus-visible { outline: 2px solid var(--ppc-ink); outline-offset: 2px; }
.ppc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.ppc-launcher {
    display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 12px 18px;
    border: 0; border-radius: 999px; background: var(--ppc-green); color: #FFFFFF;
    font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(20, 22, 27, 0.18);
}
.ppc-launcher:hover { background: var(--ppc-green-dark); }
.ppc-launcher:focus-visible { box-shadow: 0 0 0 2px #FFFFFF, 0 4px 14px rgba(20, 22, 27, 0.18); }
.ppc--open .ppc-launcher { display: none; }

.ppc-panel {
    width: 380px; max-width: calc(100vw - 40px); height: 560px; max-height: calc(100vh - 40px);
    display: flex; flex-direction: column; background: var(--ppc-surface);
    border: 1px solid var(--ppc-line); border-radius: 14px; box-shadow: 0 12px 40px rgba(20, 22, 27, 0.18); overflow: hidden;
}
.ppc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px 16px; }
.ppc-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ppc-ink); }
.ppc-tools { display: flex; align-items: center; gap: 4px; }
.ppc-plain, .ppc-close {
    min-height: 40px; min-width: 40px; padding: 8px 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--ppc-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.ppc-plain { font-size: 14px; font-weight: 600; }
.ppc-plain:hover, .ppc-close:hover { background: var(--ppc-chip); }
.ppc-plain:disabled { opacity: 0.6; cursor: wait; background: transparent; }

.ppc-log { flex: 1 1 auto; overflow-y: auto; padding: 8px 16px; border-top: 1px solid var(--ppc-line); display: flex; flex-direction: column; gap: 10px; }
.ppc-notice { margin: 0; font-size: 12px; line-height: 1.4; color: var(--ppc-muted); text-align: center; }
.ppc-msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.ppc-msg--assistant { align-self: flex-start; background: var(--ppc-ground); border: 1px solid var(--ppc-line); }
.ppc-msg--you { align-self: flex-end; background: var(--ppc-ink); color: #FFFFFF; }
.ppc-msg p { margin: 0 0 6px; }
.ppc-msg p:last-child { margin-bottom: 0; }
.ppc-msg ul { margin: 0 0 6px; padding-left: 18px; }
.ppc-msg a { color: var(--ppc-accent-ink); text-underline-offset: 0.15em; }
.ppc-msg--you a { color: #FFFFFF; }
.ppc-msg-note { font-size: 12px; opacity: 0.85; margin-top: 6px !important; }
.ppc-dots { display: flex; gap: 5px; align-items: center; height: 22px; }
.ppc-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--ppc-muted); opacity: 0.5; }
.ppc-status { margin: 0 16px; font-size: 13px; color: var(--ppc-muted); }
.ppc-status:not(:empty) { padding: 4px 0; }

.ppc-form { padding: 8px 16px 4px; border-top: 1px solid var(--ppc-line); }
.ppc-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--ppc-ink); }
.ppc-row { display: flex; gap: 8px; align-items: flex-end; }
.ppc-input {
    flex: 1 1 auto; min-height: 44px; max-height: 140px; resize: vertical; padding: 10px 12px;
    border: 1px solid #A9AAA3; border-radius: 8px; background: var(--ppc-surface); font-size: 16px; line-height: 1.4;
}
.ppc-send {
    flex: none; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 8px;
    background: var(--ppc-ink); color: #FFFFFF; font-weight: 600; cursor: pointer;
}
.ppc-send:disabled { opacity: 0.6; cursor: wait; }
.ppc-links { display: flex; gap: 16px; margin: 0; padding: 8px 16px 12px; font-size: 13px; }
.ppc-links a { color: var(--ppc-accent-ink); }

@media (max-width: 600px) {
    .ppc { right: 12px; bottom: 12px; left: 12px; align-items: flex-end; }
    .ppc--open { top: 0; right: 0; bottom: 0; left: 0; }
    .ppc-panel { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: no-preference) {
    .ppc-launcher, .ppc-plain, .ppc-close { transition: background-color 0.15s ease; }
    .ppc-dots span { animation: ppc-dot 1.2s ease-in-out infinite; }
    .ppc-dots span:nth-child(2) { animation-delay: 0.15s; }
    .ppc-dots span:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes ppc-dot {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}
@media (forced-colors: active) {
    .ppc-launcher, .ppc-send, .ppc-msg { border: 1px solid CanvasText; }
    .ppc-dots span { background: CanvasText; }
}
