/* ---------- Chat answers, input bar, sheets (layout and colours: ui.css) ---------- */
.me-card { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--panel)), var(--gold-soft)); border-radius: 16px; padding: 10px 12px; color: var(--ink); }
.me-card .me-ic { font-size: 28px; }
.me-card b { display: block; font-size: 14px; }
.me-card small { color: var(--muted); font-size: 12px; }
.me-card .xpbar { width: 100%; margin-top: 5px; height: 6px; }
.chat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 60px; }
.chat-list li { display: flex; align-items: center; gap: 6px; border-radius: 10px; padding: 8px; cursor: pointer; }
.chat-list li.cur { background: var(--gold-soft); }
.chat-list .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.chat-list .d { font-size: 11px; color: var(--muted); }
.chat-list .x { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 0 4px; opacity: .6; }
.chat-list .empty { color: var(--muted); font-size: 13px; cursor: default; }

/* Messages: lighter chrome */
.log { gap: 18px; }
.msg .avatar { display: none; }
.msg.bot .bubble { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; max-width: 100%; }
.msg.user .bubble { border-radius: 18px 18px 4px 18px; padding: 10px 14px; }
.loading { color: var(--muted); text-align: center; margin: 30vh auto 0; }
.ans { font-size: 15.5px; line-height: 1.65; }
.ans p { margin: 0 0 10px; }
.ans ul { margin: 0 0 10px; padding-left: 20px; }
.ans li { margin: 4px 0; }
.ans .muted { font-size: 13px; }
.engine-tag { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.engine-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.engine-tag.cloud .dot { background: #2b7de9; }
.engine-tag.web .dot { background: #2b7de9; }
.actions { display: flex; gap: 4px; margin: 6px 0 0 -6px; flex-wrap: wrap; }
.actions button { border: 0; background: none; color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 13px; display: inline-flex; gap: 5px; align-items: center; }
.actions button:hover, .actions button.on { background: var(--sec); color: var(--ink); }
.panel-slot > * { margin-top: 8px; }
.followups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.followups .chip { font-size: 12.5px; padding: 5px 11px; color: var(--muted); }
.ai-stop { margin-top: 6px; }

/* Input */
.bar { border-top: 0; background: transparent; padding: 8px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.ask { background: var(--panel); border: 1.5px solid var(--line); border-radius: 26px; padding: 4px; align-items: flex-end; box-shadow: var(--shadow); }
.ask:focus-within { border-color: var(--brand); }
.ask #q { border: 0; background: transparent; padding: 10px 6px; }
.ask #q:focus { outline: none; }
.in-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; font-size: 19px; cursor: pointer; flex: 0 0 auto; color: var(--ink); }
.in-btn:hover { background: var(--sec); }
.mic.rec { background: #e8505b; color: #fff; animation: recpulse 1.2s infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, #e8505b 25%, transparent); } }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 17px; flex: 0 0 auto; }
.listening { text-align: center; font-size: 13px; color: #e8505b; margin: 6px 0 0; }
.listening .pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e8505b; animation: recpulse 1.2s infinite; vertical-align: middle; }

/* Settings sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.4); display: grid; place-items: end center; }
.sheet-wrap[hidden] { display: none; }
.sheet { background: var(--panel); color: var(--ink); width: min(560px, 100%); max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 16px 16px 28px; animation: up .25s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .lbl b { display: block; font-size: 14.5px; }
.row .lbl small { color: var(--muted); font-size: 12.5px; }
.seg { display: inline-flex; background: var(--sec); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--ink); padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.seg button.on { background: var(--panel); box-shadow: var(--shadow); font-weight: 700; }
.toggle { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; cursor: pointer; }
.toggle i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle input:checked + i { background: var(--brand); }
.toggle input:checked + i::after { transform: translateX(18px); }
.field { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; margin-top: 6px; }
.btn { border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; background: var(--brand); color: #fff; }
.btn.ghost { background: var(--sec); color: var(--ink); }
.note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

.engine-tag.expert .dot { background: var(--gold); } .engine-tag.expert { color: var(--gold); font-weight: 600; }
