:root {
    --pc-green: #154d47;
    --pc-red: #cf2f2f;
    --pc-paper: #f6f4ef;
    --pc-ink: #3f3f3f;
    --pc-border: #e0dbd3;
}
[hidden] {
    display: none !important;
}
.pc-launcher {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 1000;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 40px;
    background: var(--pc-green);
    color: white;
    box-shadow: 0 8px 30px #153e4733;
    padding: 15px 22px;
    font:
        600 14px "Plus Jakarta Sans",
        sans-serif;
    cursor: pointer;
}
.pc-launcher span {
    font-size: 24px;
    margin-right: 8px;
}
.pc-dialog {
    border: 1px solid var(--pc-border);
    border-radius: 22px;
    max-width: 440px;
    width: calc(100% - 32px);
    padding: 34px;
    color: var(--pc-ink);
    background: var(--pc-paper);
    box-shadow: 0 20px 80px #0003;
    margin: auto;
    max-height: 90dvh;
    overflow: auto;
    font-family: "Plus Jakarta Sans", sans-serif;
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
    transition:
        opacity 0.25s ease-out,
        transform 0.25s ease-out,
        overlay 0.25s ease-out allow-discrete,
        display 0.25s ease-out allow-discrete;
}

.pc-dialog[open] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.pc-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0);
    transition:
        background-color 0.25s ease-out,
        overlay 0.25s ease-out allow-discrete,
        display 0.25s ease-out allow-discrete;
}

.pc-dialog[open]::backdrop {
    background-color: rgba(0, 0, 0, 0.45);
}

@starting-style {
    .pc-dialog[open]::backdrop {
        background-color: rgba(0, 0, 0, 0);
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }
}

.pc-dialog::backdrop {
    background: #153b3966;
    backdrop-filter: blur(5px);
}
.pc-dialog h2 {
    font:
        500 29px "Playfair Display",
        Georgia,
        serif;
    margin: 18px 0;
}
.pc-dialog p {
    font-size: 14px;
    line-height: 1.65;
}
.pc-eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
}
.pc-x {
    position: absolute;
    right: 12px;
    top: 9px;
    font-size: 28px !important;
}
.pc-dialog button,
.pc-session-actions button,
.pc-chat-head button {
    cursor: pointer;
    background: transparent;
    border: 0;
    color: var(--pc-green);
    padding: 10px;
    font: inherit;
    border-radius: 9px;
}

.pc-session-actions button#pc-new:not([disabled]) {
	color: var(--pc-paper);
	background: var(--pc-green);
}


.pc-session-actions button#pc-end:not([disabled]) {
	color: var(--pc-paper);
	background: var(--pc-green);
}

.pc-dialog label {
    display: block;
    font-size: 13px;
    margin: 16px 0;
}
.pc-dialog input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #ccc8be;
    border-radius: 10px;
    padding: 13px;
    margin-top: 7px;
    font: inherit;
}
.pc-primary {
    background: var(--pc-green) !important;
    color: #fff !important;
    border: 0;
    border-radius: 10px;
    padding: 13px 20px;
    cursor: pointer;
    font: inherit;
}
.pc-primary:disabled {
    opacity: 0.5;
    cursor: wait;
}
.pc-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--pc-border);
    padding-bottom: 8px;
}
.pc-tabs [aria-pressed="true"] {
    background: #e3e8e1;
}
.pc-chat {
    position: fixed;
    right: 22px;
    bottom: 88px;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: min(690px, calc(100dvh - 110px));
    z-index: 1001;
    background: var(--pc-paper);
    border: 1px solid var(--pc-border);
    border-radius: 20px;
    box-shadow: 0 16px 65px #18352c33;
    display: flex;
    flex-direction: column;
    font:
        14px "Plus Jakarta Sans",
        sans-serif;
    color: var(--pc-ink);
    overflow: hidden;
}
.pc-chat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    background: var(--pc-green);
    color: #fff;
    flex-shrink: 0;
}
.pc-chat-head button {
    color: #fff;
    font-size: 25px;
    padding: 0 10px;
}
.pc-chat-head strong {
    display: block;
    font:
        500 23px "Playfair Display",
        serif;
    letter-spacing: 1px;
}
.pc-chat-head span {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
}
.pc-disclosure {
    font-size: 10px;
    line-height: 1.55;
    padding: 10px 16px;
    margin: 0;
    border-bottom: 1px solid var(--pc-border);
    flex-shrink: 0;
}
.pc-messages {
    flex: 1;
    overflow: auto;
    min-height: 0;
    padding: 18px;
    overscroll-behavior: contain;
}
.pc-message {
    max-width: 90%;
    border: 1px solid #e8e3da;
    border-radius: 13px 13px 13px 3px;
    background: #fff;
    padding: 12px 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0 0 13px;
}
.pc-message.user {
    margin-left: auto;
    background: #e4eadf;
    border-radius: 13px 13px 3px 13px;
}
.pc-message small {
    display: block;
    opacity: 0.65;
    font-size: 10px;
    margin-bottom: 4px;
}
.pc-welcome {
    font:
        500 26px "Playfair Display",
        serif;
    margin: 20px 0 12px;
}
.pc-session-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px 10px;
}
.pc-session-actions button {
    font-size: 12px;
}
.pc-session-actions button:disabled {
    opacity: 0.4;
}
#pc-composer {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--pc-border);
    align-items: flex-end;
}
#pc-input {
    resize: none;
    max-height: 130px;
    min-width: 0;
    flex: 1;
    border: 1px solid #d8d6cd;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    font: inherit;
    line-height: 1.5;
}
#pc-error,
#pc-thinking {
    padding: 0 16px;
    font-size: 12px;
    line-height: 1.5;
    margin: 5px 0;
    color: #9c3932;
}
#pc-thinking {
    color: var(--pc-green);
}
.pc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
.pc-install {
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    font-family: system-ui;
}
.pc-install input {
    display: block;
    padding: 12px;
    margin: 10px 0;
    width: 90%;
}
.pc-install button {
    padding: 14px;
    background: var(--pc-green);
    color: #fff;
    border: 0;
}
.pc-install code {
    font-size: 18px;
    overflow-wrap: anywhere;
}
#pc-usage {
    white-space: pre-wrap;
    font-size: 11px;
    overflow-wrap: anywhere;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid #b99860;
    outline-offset: 3px;
}
@media (max-width: 600px) {
    .pc-chat {
        inset: 0;
        bottom: auto;
        width: 100%;
        max-width: none;
        height: 100dvh;
        border-radius: 0;
        border: 0;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        box-sizing: border-box;
    }
    .pc-launcher {
        right: 14px;
        bottom: max(14px, env(safe-area-inset-bottom));
    }
    .pc-dialog {
        padding: 26px;
    }
    .pc-disclosure {
        font-size: 10px;
    }
    .pc-chat-head {
        padding: 12px 16px;
    }
    #pc-input {
        font-size: 16px;
    }
    body.pc-chat-open {
        overflow: hidden;
    }
}
