:root { color-scheme: light; background: #f4f7f2; color: #203127; font: 16px/1.5 system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { width: min(720px, 100%); margin: auto; padding: 18px clamp(12px, 4vw, 26px) 30px; }
.chat-header { border-bottom: 1px solid #cad9cd; margin-bottom: 16px; }
h1 { margin: 6px 0 12px; font-size: clamp(21px, 5vw, 28px); }
h2 { font-size: 20px; }
a { color: #235743; }
#conversation { display: grid; gap: 8px; margin-bottom: 12px; }
.message { max-width: min(100%, 64ch); margin: 0; padding: 10px 13px; border-radius: 9px; background: #fff; overflow-wrap: anywhere; }
.message.visitor { justify-self: end; background: #dcecdf; }
#proposal { padding: 10px 14px; margin-block: 12px; border: 1px solid #afc6b5; border-radius: 9px; background: #fff; }
dl { display: grid; grid-template-columns: minmax(92px, 150px) 1fr; gap: 6px 10px; }
dt { font-weight: 650; }
dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 10px; }
button, textarea { font: inherit; }
button { min-height: 44px; border: 1px solid #8baa96; border-radius: 7px; padding: 6px 12px; background: white; color: #224f3a; cursor: pointer; }
button.primary, #send { background: #235642; color: #fff; border-color: #235642; }
button:disabled { opacity: .55; }
#message-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; align-items: end; }
#message-form label { grid-column: 1 / -1; }
textarea { width: 100%; padding: 6px; border: 1px solid #8baa96; border-radius: 7px; min-height: 44px; }
#error { color: #a02023; }
.sources { padding-left: 1.4em; overflow-wrap: anywhere; }

:is(#working, #circle-working) {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #235642;
}
:is(#working, #circle-working)::before {
    content: "";
    flex: 0 0 18px;
    height: 18px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    background: linear-gradient(currentColor, currentColor) center 2px / 1.5px 6px no-repeat;
    animation: research-clock 1s steps(12, end) infinite;
}
@keyframes research-clock { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    :is(#working, #circle-working)::before { animation: none; }
}

#publish-form { display: grid; justify-items: start; gap: 6px; margin-block: 12px; }
#contributor-email { width: min(100%, 360px); min-height: 44px; padding: 6px 10px; border: 1px solid #8baa96; border-radius: 7px; font: inherit; }
#contributor-email-purpose { max-width: 60ch; margin-bottom: 4px; }

#circle-working[data-finished]::before { display: none; }
