/* ============ PAWS · Digital Office — v2 dashboard.css ============ */
/* Client-facing (LIGHT) theme: Inter, white cards on #F8FAFC, PAWS blue
   #4183D7 → navy #002B5C accents, slate text. Matches onboarding.css tokens. */
:root {
  --lens: #4183D7;
  --deep: #002B5C;
  --text: #475569;
  --dim: #94A3B8;
  --bright: #0F172A;
  --border: rgba(0, 43, 92, 0.08);
  --border2: #D7E1EE;
  --bg: #F8FAFC;
  --green: #059669;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--bright);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.off-wrap { max-width: 1180px; margin: 0 auto; padding: 20px 20px 60px; }

/* ---------- topbar ---------- */
.off-top {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0 14px; flex-wrap: wrap;
  position: sticky; top: 0; background: #F8FAFC; z-index: 40;
}
.off-top .bck {
  font-size: 22px; text-decoration: none; color: var(--text);
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border2); border-radius: 10px; background: #fff;
}
.off-top .bck:hover { color: var(--lens); border-color: var(--lens); }
.off-top h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; margin: 0; color: var(--deep); }
.off-top .sub { font-size: 12px; color: var(--dim); font-weight: 500; }
.comp-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border2); border-radius: 99px;
  padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--deep);
}
.comp-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(5,150,105,.15); }
.lang { display: inline-flex; gap: 2px; background: #fff; border: 1px solid var(--border2); border-radius: 99px; padding: 3px; }
.lang button { border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--dim); padding: 4px 10px; border-radius: 99px; cursor: pointer; }
.lang button.on { background: linear-gradient(135deg, var(--lens), var(--deep)); color: #fff; }
#authArea { margin-left: auto; }
#authArea .btn, .mini-user { font-size: 12px; }

/* ---------- buttons ---------- */
.btn-p {
  background: linear-gradient(135deg, var(--lens), var(--deep));
  color: #fff; border: 0; border-radius: 10px; font: inherit;
  font-size: 13px; font-weight: 700; padding: 9px 18px; cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.btn-p:hover { box-shadow: 0 6px 18px rgba(65,131,215,.32); }
.btn-p:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn-p.xs { padding: 6px 12px; font-size: 11.5px; border-radius: 8px; }
.btn-s {
  background: #fff; border: 1px solid var(--border2); color: var(--text);
  border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600;
  padding: 7px 13px; cursor: pointer; transition: border-color .15s, color .15s;
}
.btn-s:hover { border-color: var(--lens); color: var(--lens); }
.btn-s.xs { padding: 5px 10px; font-size: 11px; }
.btn-danger { color: #DC2626; }
.btn-danger:hover { border-color: #DC2626; color: #DC2626; }

/* ---------- panes ---------- */
.off-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pane {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
  overflow: hidden;
}
.pane-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
}
.pane-h .tt { font-size: 13.5px; font-weight: 800; color: var(--deep); letter-spacing: -0.1px; }
.pane-h .sub { font-size: 11px; color: var(--dim); margin-left: auto; font-weight: 500; }
.pane-body { padding: 14px 16px; }

.section-kicker { font-size: 10.5px; font-weight: 700; color: var(--lens); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 4px; }
.kicker-pane .pane-h { border-bottom: 0; padding-bottom: 0; }

/* ---------- chat pane ---------- */
.chat-stack { display: flex; flex-direction: column; height: 520px; }
.chat-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: #D7E1EE; border-radius: 3px; }
.bubble {
  max-width: 86%; padding: 9px 13px; border-radius: 12px; font-size: 13px;
  white-space: pre-wrap; word-wrap: break-word; line-height: 1.5;
}
.bubble.max { background: #F1F5F9; border: 1px solid #E2E8F0; color: var(--bright); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.user { background: #EBF1FA; border: 1px solid #CBD8EE; color: var(--deep); align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.warn { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.typing { display: inline-flex; gap: 4px; padding: 10px 12px; align-self: flex-start; background: #F1F5F9; border-radius: 12px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--lens); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity:.25; } 40% { opacity:1; } }
.chat-sugs { display: flex; gap: 7px; padding: 10px 14px 0; flex-wrap: wrap; }
.chat-sugs .qc {
  border: 1px solid rgba(65,131,215,.3); background: #EFF6FF; color: var(--lens);
  border-radius: 99px; padding: 5px 12px; font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.chat-sugs .qc:hover { background: #E2EDFF; }
.chat-input { display: flex; gap: 9px; padding: 11px 14px 14px; border-top: 1px solid var(--border); }
.chat-input input {
  flex: 1 1 auto; min-width: 0; border: 1.5px solid var(--border2); border-radius: 10px;
  padding: 10px 13px; font: inherit; font-size: 13px; color: var(--bright); background: #fff; outline: none;
}
.chat-input input:focus { border-color: var(--lens); box-shadow: 0 0 0 3px rgba(65,131,215,.12); }
.chat-input input:disabled { background: #F1F5F9; color: var(--dim); }
.convo-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px 0; }
.convo-bar select {
  border: 1px solid var(--border2); border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 12px;
  color: var(--text); background: #fff; outline: none; max-width: 100%;
}
.convo-bar .nb { margin-left: auto; font-size: 11px; color: var(--dim); }

/* ---------- knowledge base ---------- */
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-item {
  border: 1px solid var(--border2); border-radius: 10px; padding: 10px 12px;
  background: #fff; transition: border-color .15s;
}
.kb-item:hover { border-color: rgba(65,131,215,.35); }
.kb-item .k1 { display: flex; align-items: center; gap: 8px; }
.kb-item .kt { font-weight: 700; font-size: 12.5px; color: var(--deep); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-item .kc { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--lens); background: #EFF6FF; border-radius: 99px; padding: 2px 8px; flex-shrink: 0; }
.kb-item .kb-body { font-size: 12px; color: var(--text); margin: 6px 0 0; white-space: pre-wrap; word-wrap: break-word; }
.kb-item .k2 { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.kb-item .k2 .btn { font-size: 11px; padding: 4px 9px; }
.kb-item .k2 .sp { margin-left: auto; }
/* toggle switch */
.switch { position: relative; width: 30px; height: 17px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: #D7E1EE; border-radius: 99px; transition: background .15s; }
.switch .sl:before { content: ''; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(15,23,42,.2); }
.switch input:checked + .sl { background: var(--lens); }
.switch input:checked + .sl:before { transform: translateX(13px); }
.kb-edit textarea { width: 100%; border: 1.5px solid var(--border2); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 12px; min-height: 48px; resize: vertical; outline: none; }
.kb-edit textarea:focus { border-color: var(--lens); }
.kb-add { border-top: 1px solid var(--border); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.kb-add input, .kb-add select, .kb-add textarea {
  border: 1.5px solid var(--border2); border-radius: 8px; padding: 8px 11px; font: inherit; font-size: 12.5px; color: var(--bright); background: #fff; outline: none;
}
.kb-add input:focus, .kb-add select:focus, .kb-add textarea:focus { border-color: var(--lens); }
.kb-add textarea { min-height: 54px; resize: vertical; }
.kb-add .row2 { display: flex; gap: 8px; }
.kb-add .row2 input { flex: 1 1 auto; min-width: 0; }
.kb-add .row2 select { width: 130px; flex-shrink: 0; }
.kb-empty { text-align: center; padding: 26px 16px; color: var(--dim); font-size: 12.5px; }

/* ---------- agent card ---------- */
.agent-card { display: flex; flex-direction: column; gap: 10px; }
.agent-row { display: flex; align-items: center; gap: 10px; }
.agent-row .ava {
  width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--lens), var(--deep));
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.agent-row .who { min-width: 0; }
.agent-row .who b { font-size: 14px; color: var(--deep); display: block; line-height: 1.25; }
.agent-row .who span { font-size: 11.5px; color: var(--dim); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--green); background: #ECFDF5; border: 1px solid #A7F3D0; padding: 3px 9px; border-radius: 99px; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.plan-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #8B5CF6; background: #F3E8FF; border: 1px solid #E9D5FF; padding: 2px 8px; border-radius: 99px; }
.greet-edit { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.greet-edit textarea { width: 100%; border: 1.5px solid var(--border2); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 12px; min-height: 46px; resize: vertical; outline: none; }
.greet-edit textarea:focus { border-color: var(--lens); }
.greet-edit .row { display: flex; gap: 8px; align-items: center; }
.greet-status { font-size: 11px; font-weight: 600; color: var(--green); }
.greet-status.err { color: #B91C1C; }

/* ---------- embed snippet ---------- */
.embed-note { font-size: 12px; color: var(--text); margin: 0 0 10px; line-height: 1.5; }

/* ---------- AI roadmap ---------- */
.road-kick { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--lens); margin: 12px 0 6px; }
.road-kick:first-child { margin-top: 0; }
.road-heard { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 0 0 4px; padding: 0; }
.road-heard li { font-size: 12px; color: var(--text); background: #F8FAFC; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; line-height: 1.45; }
.road-heard li b { color: var(--lens); font-size: 9.5px; text-transform: uppercase; display: block; margin-bottom: 2px; }
.road-rec { border: 1px solid var(--border2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.road-rec .r-t { font-size: 12.5px; font-weight: 800; color: var(--deep); }
.road-rec .r-d { font-size: 11.5px; color: var(--text); margin-top: 3px; line-height: 1.5; }
.road-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.road-acts .btn-p { text-decoration: none; text-align: center; }
.road-note { font-size: 11px; color: var(--dim); }
.road-empty p { font-size: 12px; color: var(--text); line-height: 1.5; margin: 0 0 10px; }

/* ---------- guided diagnostic (in-chat) ---------- */
.dx-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 10px; padding: 0 14px; }
.dx-chips .qc { border: 1px solid rgba(65,131,215,.3); background: #EFF6FF; color: var(--lens); border-radius: 99px; padding: 6px 13px; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: background .15s; }
.dx-chips .qc:hover { background: #E2EDFF; }
.dx-skip { display: block; margin: -4px 0 10px; padding: 0 14px; font-size: 11.5px; color: var(--dim); background: none; border: none; cursor: pointer; text-decoration: underline; }
.code-box {
  background: #0F172A; border-radius: 10px; padding: 11px 13px; margin: 0 0 10px;
  display: flex; align-items: flex-start; gap: 10px;
}
.code-box code {
  font-family: 'JetBrains Mono', Menlo, monospace; font-size: 11px; color: #B7C5D9;
  white-space: pre-wrap; word-break: break-all; flex: 1 1 auto; user-select: all; cursor: copy;
}
.copy-btn { flex-shrink: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: #E2E8F0; border-radius: 7px; padding: 5px 10px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.16); }
.copy-btn.ok { color: #6EE7B7; border-color: rgba(110,231,183,.4); }
.embed-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- settings ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set-f { display: flex; flex-direction: column; gap: 4px; }
.set-f.full { grid-column: 1 / -1; }
.set-f label { font-size: 10.5px; font-weight: 700; color: var(--text); letter-spacing: .02em; }
.set-f input, .set-f textarea {
  width: 100%; border: 1.5px solid var(--border2); border-radius: 8px; padding: 8px 11px;
  font: inherit; font-size: 12.5px; color: var(--bright); background: #fff; outline: none;
}
.set-f input:focus, .set-f textarea:focus { border-color: var(--lens); }
.set-f textarea { resize: vertical; min-height: 40px; }
.set-acts { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.set-status { font-size: 11.5px; color: var(--dim); font-weight: 600; }
.set-status.ok { color: var(--green); }
.set-status.err { color: #B91C1C; }

/* ---------- setup checklist ---------- */
.setup {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.setup-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.setup-tt { font-size: 13.5px; font-weight: 800; color: var(--deep); letter-spacing: -0.1px; }
.setup-sub { font-size: 11.5px; color: var(--dim); font-weight: 500; }
.setup-steps { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.s-step {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: #F8FAFC; border: 1px solid var(--border2); border-radius: 99px;
  padding: 6px 13px 6px 6px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text);
  transition: border-color .15s, background .15s;
}
.s-step:hover { border-color: var(--lens); }
.s-step .s-num {
  width: 22px; height: 22px; border-radius: 50%; background: #E2E8F0; color: #64748B;
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.s-step .s-num::after { content: none; }
.s-step.done { border-color: #A7F3D0; background: #ECFDF5; color: #065F46; }
.s-step.done .s-num { background: var(--green); color: #fff; font-size: 0; }
.s-step.done .s-num::after { content: '✓'; font-size: 12px; }
.setup-done { display: none; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: #065F46; flex-wrap: wrap; }
  .setup-next { color: #0F766E; font-weight: 700; }
  .setup-next::before { content: '·'; margin-right: 8px; color: #94A3B8; font-weight: 400; }
.setup-done-ic {
  width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff;
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.setup.all-done .setup-steps { display: none; }
.setup.all-done .setup-done { display: flex; }

/* ---------- guidance chips & hints ---------- */
.tone-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tone-chip {
  border: 1px solid var(--border2); background: #fff; color: var(--text);
  border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.tone-chip:hover { border-color: var(--lens); color: var(--lens); }
.tone-chip.on { background: #EFF6FF; border-color: var(--lens); color: var(--lens); font-weight: 700; }
.mini-hint { font-size: 11px; color: var(--dim); font-weight: 500; }
.qa-row { display: flex; gap: 6px; flex-wrap: wrap; }
.qa-chip {
  border: 1px dashed #BFD3EE; background: #fff; color: var(--lens);
  border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.qa-chip:hover { border-color: var(--lens); background: #EFF6FF; }

/* ---------- embed preview mock ---------- */
.embed-mock { border: 1px solid var(--border2); border-radius: 10px; overflow: hidden; margin: 0 0 10px; background: #fff; }
.mock-bar { display: flex; align-items: center; gap: 5px; padding: 7px 10px; background: #F1F5F9; border-bottom: 1px solid var(--border); }
.mock-bar i { width: 7px; height: 7px; border-radius: 50%; background: #E2E8F0; display: inline-block; }
.mock-bar .mock-url { font-size: 10px; color: var(--dim); margin-left: 6px; }
.mock-body { position: relative; padding: 24px 14px 32px; }
.mock-lines { display: flex; flex-direction: column; gap: 6px; max-width: 75%; }
.mock-lines i { height: 7px; border-radius: 3px; background: #EEF2F7; display: block; }
.mock-lines i:nth-child(2) { width: 82%; }
.mock-lines i:nth-child(3) { width: 58%; }
.mock-orb {
  position: absolute; right: 12px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lens), var(--deep));
  box-shadow: 0 4px 12px rgba(65,131,215,.35);
  display: flex; align-items: center; justify-content: center;
}
.embed-steps { display: flex; flex-direction: column; gap: 5px; margin: 0 0 10px; }
.e-step { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text); font-weight: 500; }
.e-step b {
  width: 18px; height: 18px; border-radius: 50%; background: #EFF6FF; color: var(--lens);
  font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.embed-tip { font-size: 11px; color: var(--dim); margin: 10px 0 0; line-height: 1.5; }
.embed-noweb { font-size: 11px; color: var(--dim); margin: 8px 0 0; line-height: 1.5; padding: 8px 10px; background: #F8FAFC; border: 1px dashed var(--border2); border-radius: 8px; }
#emailLink { text-decoration: none; }
#emailLink:hover { text-decoration: underline; }

/* ---------- settings quick links ---------- */
.plan-link { font-size: 11.5px; font-weight: 700; color: var(--lens); text-decoration: none; }
.plan-link:hover { text-decoration: underline; }
.set-f .mini-hint { margin-top: -1px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #0F172A; color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 10px 18px; border-radius: 99px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 999; max-width: 88vw; text-align: center;
  box-shadow: 0 8px 30px rgba(15,23,42,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }

/* ---------- shared auth modal (auth.js renders this — page must style it) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9998; display: none;
  background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
  justify-content: center; align-items: flex-start; overflow-y: auto; padding: 0 12px;
}
.modal-overlay.open { display: flex; }
body.modal-open { overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .off-grid { grid-template-columns: 1fr; }
  .chat-stack { height: 460px; }
  /* clamp subtitle to ONE line so EN/繁 toggling never changes the bar height */
  .off-top .sub {
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden; white-space: normal;
  }
}
@media (max-width: 700px) {
  /* hide the decorative subtitle on phones/tablets: its intrinsic width
     differs per language and pushes the top bar to wrap differently */
  .off-top .sub { display: none; }
}
@media (max-width: 560px) {
  .off-wrap { padding: 12px 12px 50px; }
  .off-top { gap: 8px; align-items: center; }
  .off-top .bck { width: 38px; height: 38px; font-size: 24px; }
  .off-top h1 { font-size: 16px; line-height: 1.2; }
  .off-top .sub { font-size: 11px; line-height: 1.3; }
  .comp-pill, .status-pill { padding: 4px 10px; font-size: 11px; gap: 6px; }
  .plan-badge { font-size: 9px; padding: 2px 7px; }
  .setup { padding: 12px 12px; margin-bottom: 12px; }
  .setup-sub { display: none; }
  .s-step { padding: 6px 11px 6px 6px; font-size: 11.5px; }
  .tone-chip, .qa-chip { padding: 6px 13px; font-size: 12px; }
  .set-grid { grid-template-columns: 1fr; }
  .chat-stack { height: 440px; }
  /* tidy pane headers, free space for the convo selector */
  .pane-h { padding: 12px 14px 10px; }
  .pane-h .sub { display: none; }
  .pane-body { padding: 12px 14px; }
  .convo-bar { flex: 1 1 auto; min-width: 0; }
  .convo-bar select { flex: 1 1 auto; min-width: 0; max-width: 160px; }
  /* knowledge-base add row: stack title + category instead of squeezing */
  .kb-add { padding: 12px 14px 14px; }
  .kb-add .row2 { flex-direction: column; align-items: stretch; }
  .kb-add .row2 select { width: 100%; }
  /* comfier tap targets */
  .btn-p.xs { padding: 8px 14px; }
  .btn-s.xs { padding: 7px 12px; }
  /* 16px input font prevents iOS focus-zoom */
  .chat-input input, .kb-add input, .kb-add select, .kb-add textarea,
  .set-f input, .set-f textarea, .greet-edit textarea, .kb-edit textarea { font-size: 16px; }
  input, select, textarea, button { max-width: 100%; }
}
@media (max-width: 390px) {
  body { overflow-x: hidden; }
  .off-top h1 { font-size: 15px; }
  .bubble { max-width: 92%; }
  .chat-sugs .qc { font-size: 11px; }
}
/* connect whatsapp pane */
.wa-row { display: flex; gap: 8px; margin-top: 4px; }
.wa-row input { flex: 1 1 auto; min-width: 0; padding: 8px 12px; border: 1px solid var(--line, #dfe5ec); border-radius: 8px; font-family: inherit; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.wa-row input:focus { outline: none; border-color: var(--brand, #4183D7); }
.wa-ok .wa-line { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 8px 0 2px; }
.wa-check { color: #1a9e5c; font-weight: 700; }
.wa-status { font-size: 12px; margin-top: 8px; min-height: 16px; }
.wa-status.ok { color: #1a9e5c; }
.wa-status.err { color: #c0392b; }
.wa-ok .embed-tip, .wa-row + .embed-tip { margin-top: 6px; }
