/* Reply Desk: sea teal = the AI did it, amber = needs you. Same look as the live demo. */
:root {
  --bg: #eef3f1; --card: #ffffff; --card-2: #f5f8f7; --text: #13201c; --muted: #5d6d67; --line: #d9e3df;
  --brand: #0e7a6d; --brand-soft: #d8efe9; --warn: #b8650a; --warn-soft: #fdecd3; --bad: #b42318;
  --in: #ffffff; --out: #d6f0e8; --note: #fff6e6; --chat: #e4ebe8; --on-brand: #ffffff;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif; --body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c1311; --card: #141d1a; --card-2: #19241f; --text: #e5eeea; --muted: #93a39d; --line: #26332e;
    --brand: #3fd0b9; --brand-soft: #123b34; --warn: #f5b04a; --warn-soft: #3b2a10; --bad: #f87171;
    --in: #1b2622; --out: #11423a; --note: #2f2715; --chat: #101916; --on-brand: #06201b; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--body); }
h1, h2, h3 { font-family: var(--display); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 12px; padding: 12px 16px; background: var(--brand-soft); color: var(--text); font-weight: 600; }
button.primary { background: var(--brand); color: var(--on-brand); }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.danger { background: transparent; border: 1px solid var(--line); color: var(--bad); }
button:disabled { opacity: .5; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
textarea, input[type=password], input[type=text], select { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px; }
textarea { resize: vertical; min-height: 90px; }
header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
header h1 { font-size: 19px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header button { padding: 8px 12px; font-size: 14px; }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px calc(env(safe-area-inset-bottom) + 28px); }
.banner { background: var(--warn-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.list a { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; }
.list .row { display: flex; justify-content: space-between; gap: 8px; }
.list .name { font-weight: 600; }
.list .time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.list .last { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--line); color: var(--muted); }
.pill.question { background: var(--warn-soft); color: var(--warn); }
.pill.approve, .pill.booked { background: var(--brand-soft); color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.msgs { display: flex; flex-direction: column; gap: 6px; padding: 12px; margin: 8px -4px 12px; background: var(--chat); border-radius: 18px; }
.msg { max-width: 85%; padding: 8px 12px 6px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.customer { align-self: flex-start; background: var(--in); border-bottom-left-radius: 4px; }
.msg.ai, .msg.staff { align-self: flex-end; background: var(--out); border-bottom-right-radius: 4px; }
.msg.note { align-self: center; background: var(--note); font-size: 14px; max-width: 95%; border-radius: 12px; }
.msg.system { align-self: center; background: var(--card); border: 1px solid var(--brand); color: var(--brand); font-size: 13px; border-radius: 99px; padding: 4px 12px; max-width: 95%; text-align: center; }
.msg .meta { display: flex; gap: 6px; justify-content: flex-end; align-items: center; font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg .err { color: var(--bad); font-size: 13px; display: block; }
.badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.badge.auto { background: var(--brand-soft); color: var(--brand); }
.badge.you { background: var(--warn-soft); color: var(--warn); }
.card { background: var(--card); border: 2px solid var(--brand); border-radius: 18px; padding: 14px; margin: 8px 0 12px; display: grid; gap: 10px; }
.card.question { border-color: var(--warn); }
.card .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.card.question .k { color: var(--warn); }
.card .q { font: 600 19px/1.35 var(--display); }
.card .ctx { font-size: 13px; color: var(--muted); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns button { flex: 1 1 40%; padding: 14px; font-size: 16px; min-height: 50px; }
.row-inline { display: flex; gap: 8px; align-items: flex-start; }
.row-inline textarea { flex: 1; min-height: 56px; }
.mic { width: 52px; height: 52px; padding: 0; font-size: 22px; flex: none; }
.mic.on { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.small { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.toolbar button { padding: 9px 12px; font-size: 14px; }
.toolbar button.on { background: var(--brand); color: var(--on-brand); }
section { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; display: grid; gap: 10px; }
section h2 { margin: 0; font-size: 17px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; background: transparent; border: 1px solid var(--line); font-size: 14px; }
.seg button.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.facts { display: grid; gap: 8px; }
.fact { display: flex; gap: 8px; align-items: flex-start; background: var(--card-2); border-radius: 12px; padding: 10px 12px; }
.fact .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fact .src { font-size: 12px; color: var(--muted); display: block; }
.fact button { padding: 6px 10px; font-size: 13px; flex: none; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 9; max-width: 90vw; text-align: center; }
.updbar { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 20; display: flex; align-items: center; gap: 12px; justify-content: space-between; background: var(--text); color: var(--bg); padding: 10px 10px 10px 16px; border-radius: 16px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 560px; margin: 0 auto; }
.updbar button { padding: 10px 18px; }
