/* Support chat panel and sign-up dialog. Colors come from the tokens in index.html. */
.chat { position: fixed; z-index: 30; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 120px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 12px 40px rgba(18,24,38,.22); display: flex; flex-direction: column; overflow: hidden; }
.chat-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-h .dot { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; flex: none; }
.chat-h b { display: block; font-size: 14px; }
.chat-h small { color: var(--muted); font-size: 12px; }
.chat-h .x { margin-left: auto; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.err { background: var(--bad-soft); color: var(--bad); align-self: stretch; max-width: none; font-size: 13px; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-sug { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-sug button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; color: var(--ink); }
.chat-sug button:hover { border-color: var(--accent); color: var(--accent); }
.handoff { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.handoff input, .handoff textarea, .chat-f textarea, .modal input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; color: var(--ink); }
.handoff textarea { min-height: 70px; resize: vertical; }
.chat-f { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-f textarea { resize: none; height: 40px; max-height: 120px; }
.chat-f .btn { height: 40px; }
.chat-foot { display: flex; justify-content: space-between; gap: 8px; padding: 0 12px 10px; font-size: 12px; color: var(--faint); }
.chat-foot button { border: 0; background: none; padding: 0; color: var(--accent); font-size: 12px; }

.modal-bg { position: fixed; inset: 0; z-index: 40; background: rgba(10,14,20,.45); display: grid; place-items: center;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.modal { background: var(--surface); border-radius: 16px; width: min(440px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal h2 { margin: 0; font-family: var(--f-display); font-size: 22px; }
.modal p { margin: 0; color: var(--muted); }
.modal form { display: flex; flex-direction: column; gap: 10px; }
.modal .plans { display: flex; gap: 6px; flex-wrap: wrap; }
.modal .plans label { display: inline-flex; gap: 6px; align-items: center; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.modal .plans input { width: auto; accent-color: var(--accent); margin: 0; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; }
.form-msg { font-size: 13px; min-height: 1em; }
.form-msg.bad { color: var(--bad); } .form-msg.good { color: var(--good); }
