/* Web chat and the embed page. Neutral styling, no client marks, no external resources. */
:root {
  color-scheme: light;
  --ink: #10171f; --ink-2: #2a3542; --muted: #4a5560; --cream: #faf7f2; --surface: #ffffff;
  --rule: #d9d3c8; --rule-strong: #8a8f96; --accent: #b05200; --focus: #0b4fd6;
  --danger: #a3200f; --danger-bg: #fdf1ee; --ok: #0b6b4f; --warn: #7a4d00; --warn-bg: #fff6e0;
  --bubble-you: #e8eefc; --bubble-bot: #f4f1ea; --r: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.icon-lg { width: 2rem; height: 2rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
.hd :focus-visible { outline-color: #fff; box-shadow: 0 0 0 5px var(--ink); }
.skip { position: absolute; left: 8px; top: -60px; background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 8px; z-index: 50; border: 2px solid var(--ink); }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }

.hd { background: var(--ink); color: #fff; }
.hd-in { max-width: 46rem; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.hd-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hd-title .icon-lg { color: #ff7700; }
.hd h1 { margin: 0; color: #fff; }
.sub { margin: 0; color: #e6eaee; }
.hd .btn { background: transparent; color: #fff; border-color: #fff; }
.hd .btn:hover { background: #222d3a; }

main, #main { max-width: 46rem; margin: 0 auto; padding: 16px; }
.ft { max-width: 46rem; margin: 0 auto; padding: 8px 16px 24px; color: var(--muted); font-size: .92rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; font: inherit; font-weight: 600; color: var(--ink); background: var(--surface); border: 2px solid var(--ink); border-radius: var(--r); cursor: pointer; text-decoration: none; }
.btn:hover { background: #efe9dd; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { cursor: not-allowed; color: #59616b; border-color: #8a8f96; background: #f1eee8; }
.btn-primary { background: var(--ink); color: #fff; } .btn-primary:hover { background: #222d3a; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; } .btn-danger:hover { background: #82190b; }
.linkbtn { background: none; border: 0; padding: 8px 0; min-height: 44px; font: inherit; color: var(--focus); text-decoration: underline; cursor: pointer; }

.disclose { background: var(--warn-bg); border: 2px solid var(--warn); color: #3b2500; border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; }
.disclose h2 { font-size: 1.05rem; } .disclose p:last-child { margin-bottom: 0; }
.strong { font-weight: 700; }
.tel { color: var(--ink); font-weight: 700; text-decoration: underline; }
.tel.big { font-size: 1.6rem; }
.emergency { display: flex; gap: 14px; align-items: flex-start; background: var(--danger-bg); border: 3px solid var(--danger); color: #5a1208; border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.emergency .icon-lg { color: var(--danger); margin-top: 4px; }
.em-h { font-size: 1.3rem; font-weight: 800; margin: 0 0 8px; }

.chat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; }
.log { height: min(52vh, 28rem); overflow-y: auto; border: 1px solid var(--rule); border-radius: var(--r); padding: 10px; background: #fffdf8; scroll-behavior: smooth; }
.msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.msg { max-width: 92%; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--rule-strong); }
.msg .who { display: block; font-weight: 700; font-size: .82rem; color: var(--ink-2); margin-bottom: 2px; }
.msg p { margin: 0; white-space: pre-wrap; }
.msg.bot { background: var(--bubble-bot); justify-self: start; }
.msg.you { background: var(--bubble-you); justify-self: end; border-color: #6c82c9; }
.typing { color: var(--muted); margin: 8px 2px 0; min-height: 1.5em; }
.dots i { display: inline-block; width: .35em; height: .35em; border-radius: 50%; background: currentColor; margin-left: .25em; animation: t-dot 1s infinite var(--ease); }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes t-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.error { color: var(--danger); background: var(--danger-bg); border: 2px solid var(--danger); border-radius: var(--r); padding: 10px 12px; font-weight: 600; margin: 8px 0 0; }
.notice { background: var(--warn-bg); border: 2px solid var(--warn); border-radius: var(--r); padding: 10px 12px; margin: 10px 0 0; }

form { margin-top: 12px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
textarea { width: 100%; min-height: 3.2rem; font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--rule-strong); border-radius: var(--r); padding: 8px 12px; resize: vertical; }
.hint { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }
.count { text-align: right; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

.photo { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.photo h2 { font-size: 1.05rem; }
.photo-status { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; margin: 8px 0 0; }
.msg .thumb { display: block; width: 7.5rem; height: 7.5rem; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule-strong); background: #fff; margin: 4px 0; }
.msg .thumb-ph { display: flex; align-items: center; justify-content: center; width: 7.5rem; height: 7.5rem; border-radius: 8px; border: 1px solid var(--rule-strong); background: #fff; margin: 4px 0; color: var(--ink-2); }
.msg .thumb-ph .icon { width: 2.4rem; height: 2.4rem; }
.msg .cap { font-size: .92rem; color: var(--ink-2); }
.office { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--r); padding: 14px 16px; margin-top: 14px; }
.office h2:focus { outline: none; }
.hours { margin: 0 0 12px; padding-left: 1.2rem; }
.state-line { font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 700; padding: 1px 10px; border-radius: 999px; border: 1px solid currentColor; }
.badge.ok { color: var(--ok); background: #e9f6f0; } .badge.warn { color: var(--warn); background: var(--warn-bg); }

body.embedded .hd { display: none; }
body.embedded .ft { display: none; }
body.embedded #main { padding: 8px; }
body.embedded .log { height: min(42vh, 22rem); }
@media (max-width: 520px) {
  h1 { font-size: 1.2rem; }
  .actions .btn { flex: 1 1 100%; }
  .msg { max-width: 100%; }
  main { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .log { scroll-behavior: auto; }
  .dots i { animation: none; opacity: .7; }
  .btn:active { transform: none; }
  .photo-status { transition: none; }
}
