/* Responsive chat layout: works on a phone and on a laptop. */
:root { --brand: #0b2a5b; --accent: #0a7cc4; --bg: #f4f6fa; --line: #e2e6ee; --muted: #6b7486; --err: #c0392b; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; background: var(--bg); color: #1c2433;
       font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; cursor: pointer; }
.top { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center;
       padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--brand); color: #fff; }
.brand { font-weight: 700; } .brand small { font-weight: 400; opacity: .7; margin-left: 6px; } .logo { color: #5cc8ff; }
.who { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.who form { margin: 0; } .who button { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 3px 8px; }
.chat { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-width: 860px; width: 100%; margin: 0 auto; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; line-height: 1.45; }
.msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.msg.user { background: var(--accent); color: #fff; align-self: flex-end; }
.msg.error { color: var(--err); border-color: var(--err); }
.status { display: block; color: var(--muted); font-style: italic; font-size: .85rem; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; max-width: 860px; width: 100%; margin: 0 auto; }
/* "display: flex" above would override the HTML hidden attribute - make hidden win (bug found in user test) */
.suggestions[hidden] { display: none; }
.suggestions button { background: #eef4fb; border: 1px solid #d3e3f5; color: var(--accent); border-radius: 999px; padding: 6px 11px; font-size: .85rem; }
.input { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: #fff; max-width: 860px; width: 100%; margin: 0 auto; }
.input input { flex: 1; font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.input button { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 0 18px; font-weight: 600; }
.input button:disabled { opacity: .5; }
.foot { text-align: center; font-size: .72rem; color: var(--muted); padding: 4px 16px max(8px, env(safe-area-inset-bottom)); }
.link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 0; font-size: inherit; }
.denied { max-width: 520px; margin: 80px auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
/* approval card (human in the loop) */
.card { align-self: flex-start; max-width: 85%; background: #fffaf0; border: 1px solid #f0c36d; border-radius: 12px; padding: 12px 14px; }
.card-title { font-weight: 700; color: #8a5a00; margin-bottom: 4px; }
.card-buttons { display: flex; gap: 8px; margin-top: 10px; }
.card-buttons button { border-radius: 8px; padding: 6px 14px; border: 1px solid var(--line); background: #fff; }
.card-buttons button.confirm { background: var(--accent); color: #fff; border: 0; font-weight: 600; }
.card-buttons button:disabled { opacity: .5; }
.card-result { margin-top: 8px; font-size: .9rem; }

/* notification settings panel (stage 7) */
.who #bell { font-size: 1rem; padding: 2px 8px; }
.panel { max-width: 860px; width: calc(100% - 32px); margin: 12px auto 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.panel[hidden] { display: none; }
.panel h2 { margin: 0 0 6px; font-size: 1.05rem; }
.panel fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; padding: 8px 12px; display: grid; gap: 6px; }
.panel legend { font-size: .85rem; color: var(--muted); padding: 0 4px; }
.panel label { display: flex; gap: 8px; align-items: center; }
.panel-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.panel-row button:not(.link) { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 7px 14px; font-weight: 600; }
.hint { color: var(--muted); font-size: .85rem; margin: 6px 0; }
.devices { list-style: none; padding: 0; margin: 6px 0; font-size: .85rem; color: var(--muted); }
