*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:#f9f9fa;color:#0c0c0d;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",Arial,sans-serif;display:flex;flex-direction:column;min-height:100vh}
[hidden]{display:none!important}
button{font:inherit}

.hdr{padding:16px 20px}
.logo{display:inline-flex;align-items:center;gap:8px;color:#0c0c0d;text-decoration:none}
.logo:focus-visible{outline:1px dotted grey}
.logo-icon{flex:none}

main{flex:1;display:flex;flex-direction:column;align-items:center;padding:0 16px}
.card{background:#fff;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.08);padding:24px;width:100%}
.narrow{max-width:520px;margin-top:24px}
.center{text-align:center;margin-top:12vh}
h1{font-size:24px;margin:0 0 10px;font-weight:700;line-height:1.25}
p{font-size:15px;line-height:1.6;margin:0 0 16px;color:#2a2a2e}

.lbl{display:block;font-size:13px;color:#555;margin:0 0 6px}
.input{display:block;width:100%;border:1px solid #c9c9cf;border-radius:6px;padding:10px 12px;font:inherit;font-size:15px;color:#0c0c0d;background:#fff;margin:0 0 16px}
.input:focus{outline:none;border-color:#0a84ff;box-shadow:0 0 0 2px rgba(10,132,255,.25)}
.input::placeholder{color:#8f8f9d}

.btn{display:inline-block;border:0;cursor:pointer;background:#0a84ff;color:#fff;font-weight:600;font-size:15px;padding:11px 24px;border-radius:8px;text-decoration:none;line-height:1.3}
.btn:hover{background:#0060df}
.btn:focus{outline:none}
.btn:focus-visible{outline:1px dotted grey;outline-offset:2px}
.btn:disabled{opacity:.6;cursor:default}
.btn.wide{display:block;width:100%;text-align:center}
.btn.small{padding:7px 14px;font-size:14px}
.btn.ghost{background:#ededf0;color:#0c0c0d}
.btn.ghost:hover{background:#e0e0e6}
.danger-btn{background:#d70022}
.danger-btn:hover{background:#a4000f}

.icon{width:72px;height:72px;border-radius:50%;background:#ededf0;display:flex;align-items:center;justify-content:center;margin:0 auto 16px}

.room{width:100%;max-width:760px;display:flex;flex-direction:column;flex:1;min-height:0;padding-bottom:8px}
.link{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #d7d7db;border-radius:6px;padding:8px 12px;font-size:13px}
.link span{flex:1;min-width:0;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.link-btn{background:none;border:0;padding:0;color:#0a84ff;font-weight:600;cursor:pointer;white-space:nowrap;font-size:13px}
.link-btn:hover{text-decoration:underline}
.link-btn:focus{outline:none}
.link-btn:focus-visible{outline:1px dotted grey;outline-offset:2px}
.link-btn.danger{color:#d70022}
.meta{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:13px;color:#666;margin:10px 2px 0}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#2ac769;margin-right:6px}
.confirm{display:flex;flex-direction:column;gap:10px;background:#fff4f4;border:1px solid #ffc6c6;border-radius:8px;padding:10px 12px;margin-top:10px;font-size:14px}
.confirm-btns{display:flex;gap:8px;justify-content:center}

.chat{flex:1;min-height:280px;margin-top:12px;background:#fff;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.08);padding:16px;display:flex;flex-direction:column;gap:10px;overflow-y:auto}
.sys{align-self:center;font-size:12.5px;color:#888;text-align:center}
.m{max-width:78%;padding:8px 12px;border-radius:12px;font-size:15px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere}
.m small{display:block;font-size:11.5px;color:#777;margin-bottom:2px}
.in{background:#f0f0f4;align-self:flex-start;border-bottom-left-radius:4px}
.out{background:#0a84ff;color:#fff;align-self:flex-end;border-bottom-right-radius:4px}
.out small{color:#d6e9ff}
.error{margin-top:10px;font-size:13px;color:#d70022;text-align:center}
.send{display:flex;gap:8px;margin-top:12px;align-items:flex-end}
.send .input{flex:1;margin:0;resize:none;max-height:140px;line-height:1.4}

.foot{text-align:center;font-size:12px;color:#444;padding:16px}

@media (max-width:560px){
  .hdr{padding:12px 14px}
  main{padding:0 10px}
  .card{padding:18px}
  h1{font-size:21px}
  .meta{flex-wrap:wrap}
  .m{max-width:88%}
}
