/* The public DV Chat website. Self-contained on purpose: no fonts or frameworks from other websites. */
:root { --c: #5b3f8c; --c-dark: #47306f; --bg: #f6f4fa; --text: #222; --muted: #5d5d66; --line: #ddd8e8; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 16px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
       background: var(--c); color: #fff; padding: .6rem 1rem; }
.brand { font-weight: 600; font-size: 1.05rem; }
.exit { background: #c62828; color: #fff; border: 2px solid #fff; border-radius: 999px; font-weight: 700; font-size: 1rem;
        padding: .45rem 1rem; cursor: pointer; }
.exit:hover, .exit:focus { background: #a31515; }
.exit .key { font-weight: 400; font-size: .75rem; opacity: .85; margin-left: .25rem; border: 1px solid rgba(255,255,255,.6); border-radius: 4px; padding: 0 .25rem; }
.test { background: #fff3cd; color: #6b4e00; border-bottom: 1px solid #e8d28a; padding: .5rem 1rem; font-weight: 600; text-align: center; }
main { max-width: 40rem; margin: 0 auto; padding: 1rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; }
.welcome { margin-top: 0; }
.emergency { background: #fdecea; border-left: 4px solid #c62828; padding: .6rem .8rem; border-radius: 6px; }
.tips { background: #f2eff8; border-radius: 8px; padding: .6rem .8rem; margin: .8rem 0; }
.tips ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.question { font-weight: 600; font-size: 1.1rem; margin-bottom: .6rem; }
.closed { font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.row.end { justify-content: flex-end; }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: .6rem 1.1rem; border: 1px solid transparent; }
button.primary { background: var(--c); color: #fff; }
button.primary:hover, button.primary:focus { background: var(--c-dark); }
button.secondary { background: #fff; color: var(--c); border-color: var(--c); }
button.small { padding: .35rem .8rem; font-size: .9rem; }
button:disabled { opacity: .6; cursor: default; }
label { display: block; font-weight: 600; margin-bottom: .35rem; }
input, textarea { font: inherit; width: 100%; border: 1px solid #bbb; border-radius: 8px; padding: .55rem .7rem; }
input:focus, textarea:focus { outline: 2px solid var(--c); border-color: var(--c); }
.error { color: #b00020; font-weight: 600; }
.small-text { font-size: .9rem; color: var(--muted); }
.chat { display: flex; flex-direction: column; height: calc(100vh - 7.5rem); min-height: 22rem; background: #fff;
        border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.status { background: #f2eff8; padding: .55rem .8rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.log { flex: 1; overflow-y: auto; padding: .8rem; display: flex; flex-direction: column; gap: .5rem; }
.msg { max-width: 85%; padding: .5rem .75rem; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; }
.msg .who { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .1rem; }
.msg.you { align-self: flex-end; background: var(--c); color: #fff; border-bottom-right-radius: 4px; }
.msg.you .who { color: #e6dcf5; }
.msg.adv { align-self: flex-start; background: #ece9f2; border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: .9rem; text-align: center; max-width: 95%; }
.composer { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--line); }
.composer textarea { resize: none; }
.chat .error { margin: 0 .8rem .4rem; }
.chat .row { margin: 0 .6rem .6rem; }
[hidden] { display: none !important; }
@media (max-width: 480px) {
    .exit { padding: .4rem .7rem; }
    .exit .key { display: none; }
    main { padding: .5rem; }
    .chat { height: calc(100vh - 6.5rem); }
}
