.project-chat-launch {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 25;
    color: var(--ink)
}

.project-chat-launch:hover,
.project-chat .button:hover {
    background: var(--coral2)
}

.project-chat-launch[hidden],
.project-chat [hidden] {
    display: none
}

.project-chat {
    position: fixed;
    inset: auto max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto;
    width: min(430px, calc(100% - 32px));
    max-height: min(720px, calc(100dvh - 32px));
    margin: 0;
    padding: 0;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 20px 50px #151a2540;
    overflow: auto
}

.project-chat::backdrop {
    background: #151a2577
}

.project-chat header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    color: #fff;
    background: var(--ink)
}

.project-chat h2,
.project-chat h3 {
    margin: 0;
    font-size: 18px
}

.project-chat header button,
.project-chat-link {
    min-height: 44px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: .2em
}

.project-chat-body {
    padding: 16px;
    line-height: 1.5
}

.project-chat-notice,
.project-chat form p,
.project-chat-contact {
    margin: 0 0 12px;
    font-size: 13px
}

.project-chat a {
    text-decoration: underline;
    text-underline-offset: .2em
}

.project-chat-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(235px, 30dvh);
    overflow: auto;
    margin-bottom: 12px
}

.project-chat-log p {
    margin: 0;
    padding: 8px 10px;
    background: var(--paper);
    border-left: 2px solid var(--line);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px
}

.project-chat-log p[data-role="user"] {
    border-color: var(--coral)
}

.project-chat-log strong {
    display: block;
    font-size: 12px
}

.project-chat form label,
.project-chat form input,
.project-chat form textarea {
    display: block;
    width: 100%
}

.project-chat form input,
.project-chat form textarea {
    margin: 4px 0 10px;
    padding: 9px 10px;
    border: 1px solid var(--muted);
    border-radius: 4px;
    color: var(--ink);
    font: inherit;
    font-size: 16px
}

.project-chat .button {
    min-height: 44px;
    color: var(--ink)
}

.project-chat button:disabled {
    opacity: .65;
    cursor: wait
}

.project-chat-status {
    margin: 8px 0;
    font-weight: 700
}

.project-chat-status:empty {
    margin: 0
}

@media (prefers-reduced-motion: reduce) {
    .project-chat .button,
    .project-chat-launch {
        transition: none
    }

    .project-chat .button:hover,
    .project-chat-launch:hover {
        transform: none
    }
}
