* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, "Segoe UI", Arial, sans-serif; background: #eef1f5; color: #1d2733; }
.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-box { background: #fff; padding: 28px; border-radius: 12px; width: 320px; box-shadow: 0 4px 20px #0002; display: flex; flex-direction: column; gap: 12px; }
.login-box h1 { font-size: 18px; margin: 0 0 6px; }
input, textarea, button { font: inherit; }
input[type=text], input[type=password], textarea { width: 100%; padding: 9px 11px; border: 1px solid #c5ced9; border-radius: 8px; background: #fff; }
button { padding: 10px 16px; border: 0; border-radius: 8px; background: #1f6feb; color: #fff; cursor: pointer; font-weight: 600; }
button:disabled { background: #9db6dd; cursor: default; }
button.secondary { background: #e3e8ef; color: #1d2733; font-weight: 500; }
.err { color: #c62828; margin: 0; }

.app { display: flex; flex-direction: column; height: 100vh; max-width: 980px; margin: 0 auto; }
header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }
header h1 { font-size: 17px; margin: 0; }
#chat { flex: 1; overflow-y: auto; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px #0001; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: #dbe9ff; }
.msg.bot { align-self: flex-start; }
.msg .meta { color: #66788a; font-size: 12px; margin-bottom: 4px; }
.progress { font-family: Consolas, monospace; font-size: 14px; }
.qlabel { font-weight: 600; color: #1f6feb; margin-bottom: 4px; }
.bar { height: 6px; background: #e3e8ef; border-radius: 3px; margin: 6px 0; overflow: hidden; }
.bar > div { height: 100%; background: #1f6feb; width: 0; transition: width .4s; }
.result { border-top: 1px solid #e3e8ef; padding: 8px 0; white-space: normal; }
.result a { color: #1f6feb; font-weight: 600; word-break: break-all; }
.result .ok { color: #1b7f3b; }
.result .where { color: #66788a; font-size: 13px; }
.actions { display: flex; gap: 8px; margin-top: 8px; }

form#search { background: #fff; padding: 12px 16px; border-top: 1px solid #d6dde6; display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; }
form#search label { color: #4a5a6b; font-size: 14px; }
form#search .fixed { color: #1d2733; padding: 4px 0; }
form#search .full { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hint { color: #66788a; font-size: 12px; }
@media (max-width: 600px) { form#search { grid-template-columns: 1fr; } }
