/* Clinic website assistant — embeddable, phone first, light and dark. */
:root { --bg: #ffffff; --soft: #f2f5f8; --ink: #16202c; --muted: #5b6776; --line: #dde2e8; --main: #1d5fd6; --main-ink: #fff; --sos: #c4161c; --sos-bg: #fde8e8; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #141a21; --soft: #1d252f; --ink: #e8edf3; --muted: #9aa7b6; --line: #2c3642; --main: #5b93f5; --main-ink: #0b1220; --sos: #ff6b6b; --sos-bg: #3a1618; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.as { display: flex; flex-direction: column; min-height: 100vh; max-width: 520px; margin: 0 auto; }
.as-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.as-head p { margin: .1rem 0 0; color: var(--muted); font-size: .85rem; }
.as-head .as-sos { color: var(--sos); font-weight: 600; }
.as-demo { font-size: .7rem; background: #fff1dc; color: #a45a00; padding: .05rem .35rem; border-radius: 4px; vertical-align: middle; }
.as-tabs { display: flex; border-bottom: 1px solid var(--line); }
.as-tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem .25rem; font: inherit; color: var(--muted); cursor: pointer; }
.as-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--main); font-weight: 600; }
.as-panel { flex: 1; display: flex; flex-direction: column; padding: 12px 16px; gap: .75rem; }
.as-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; flex: 1; min-height: 240px; overflow-y: auto; }
.as-log li { max-width: 88%; padding: .5rem .75rem; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.as-bot { background: var(--soft); align-self: flex-start; }
.as-me { background: var(--main); color: var(--main-ink); align-self: flex-end; }
.as-err { background: var(--sos-bg) !important; color: var(--sos) !important; font-weight: 600; }
.as-quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.as-quick button, .as-row button, form button { font: inherit; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: .4rem .8rem; cursor: pointer; }
.as-send { display: flex; gap: .5rem; }
.as-send input { flex: 1; }
form button[type=submit], .as-main { background: var(--main) !important; color: var(--main-ink) !important; border-color: var(--main) !important; font-weight: 600; }
input, textarea { font: inherit; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; width: 100%; min-width: 0; }
form { display: grid; gap: .6rem; }
form label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; margin: 0; }
legend { font-weight: 700; padding: 0 .25rem; }
fieldset label { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; font-weight: 400; padding: .2rem 0; }
fieldset input { width: auto; }
.as-check { display: flex !important; gap: .5rem; align-items: center; font-weight: 400 !important; }
.as-check input { width: auto; }
.as-estimate { background: var(--soft); border-radius: 10px; padding: .5rem .9rem; }
.as-estimate ul { margin: .25rem 0; padding-left: 1.1rem; }
.as-total { font-weight: 700; margin: .25rem 0; }
.as-note { color: var(--muted); font-size: .85rem; }
.as-warn { background: var(--sos-bg); color: var(--sos); font-weight: 600; padding: .5rem .75rem; border-radius: 8px; }
.as-review pre { white-space: pre-wrap; background: var(--soft); padding: .75rem; border-radius: 10px; font: inherit; }
.as-row { display: flex; gap: .5rem; justify-content: flex-end; }
.as-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--main); outline-offset: 2px; }
