*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;background:#eef1f5;color:#1b2430}
#root{height:100%;display:flex;flex-direction:column;max-width:760px;margin:0 auto;background:#fff}
.card{margin:auto;padding:32px 28px;text-align:center;max-width:380px}
.card h1{font-size:1.5rem;margin:0 0 8px}.card p{line-height:1.5;margin:8px 0}
.btn{margin-top:16px;width:100%;font-size:1.1rem;padding:14px;border-radius:10px;border:0;background:#2f6fed;color:#fff;cursor:pointer}
.btn[disabled]{background:#c9d1da;color:#5a6673}
.err{color:#b3261e}
header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#2f6fed;color:#fff;padding-top:calc(12px + env(safe-area-inset-top))}
header b{font-size:1.1rem}header button{background:transparent;border:1px solid #fff8;color:#fff;border-radius:8px;padding:6px 10px;cursor:pointer}
#list{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px}
.m{max-width:80%;padding:9px 12px;border-radius:16px;line-height:1.4;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere}
.m.user{align-self:flex-end;background:#2f6fed;color:#fff;border-bottom-right-radius:4px}
.m.bot{align-self:flex-start;background:#e9edf2;border-bottom-left-radius:4px}
.m img{max-width:100%;max-height:300px;border-radius:10px;display:block;cursor:pointer}
.m audio{max-width:100%}
.t{font-size:.7rem;opacity:.65;margin-top:4px}
#bar{display:flex;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border-top:1px solid #dde2e8;align-items:flex-end}
#bar textarea{flex:1;font:inherit;font-size:16px;padding:10px 12px;border:1px solid #c9d1da;border-radius:18px;resize:none;max-height:120px;min-height:44px}
#bar button{width:44px;height:44px;border-radius:22px;border:0;background:#e9edf2;font-size:1.2rem;cursor:pointer;flex:none}
#bar button.send{background:#2f6fed;color:#fff}#bar button.rec{background:#d93025;color:#fff}
#status{font-size:.8rem;padding:0 14px 4px;color:#6b7785;min-height:1.2em}

.tag{display:inline-block;font-size:.7rem;font-weight:600;padding:1px 7px;border-radius:9px;background:#fff3;margin-bottom:4px}
.m.bot .tag{background:#2f6fed22}
.badge{font-size:.75rem;background:#fff3;border-radius:9px;padding:2px 8px;margin-left:8px}
.acts{display:flex;gap:8px;padding:6px 12px 0;flex-wrap:wrap}
.acts button{font:inherit;font-size:.85rem;padding:6px 12px;border-radius:16px;border:1px solid #c9d1da;background:#fff;cursor:pointer}
.acts button.on{background:#fff4d6;border-color:#e0b200}
.acts button.call{background:#fde8e6;border-color:#d93025;color:#8c1d18}
.adm{padding:16px;overflow:auto;flex:1}
.adm h2{font-size:1.1rem;margin:22px 0 8px}
.adm table{border-collapse:collapse;width:100%;font-size:.85rem}
.adm th,.adm td{border-bottom:1px solid #e3e7ec;padding:6px 6px;text-align:left;vertical-align:middle}
.adm th{font-weight:600;color:#445}
.adm .scroll{overflow-x:auto}
.adm input,.adm select{font:inherit;font-size:.85rem;padding:5px 6px;border:1px solid #c9d1da;border-radius:6px;max-width:100%}
.adm button{font:inherit;font-size:.8rem;padding:5px 9px;border-radius:6px;border:1px solid #c9d1da;background:#fff;cursor:pointer;margin:2px}
.adm button.pri{background:#2f6fed;color:#fff;border-color:#2f6fed}
.adm button.danger{color:#b3261e;border-color:#e9b8b4}
.adm .link{width:100%;margin-top:4px}
.adm .note{color:#6b7785;font-size:.8rem;margin:4px 0}
.v-yes{background:#e3f6e8}.v-own{background:#e6f0ff}.v-ask{background:#fff4d6}.v-blocked{background:#fde8e6}
header>div:last-child{display:flex;gap:6px;align-items:center}
.approval{background:#fff8e1;border:1px solid #f0d27a;border-radius:12px;padding:10px;color:#333}
