*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:-apple-system,BlinkMacSystemFont,'Hiragino Sans','Yu Gothic',sans-serif;color:#222;background:#f7f8fa}
body{display:flex;flex-direction:column;height:100vh;overflow:hidden}
header{background:#4f779a;color:#fff;padding:8px 14px;font-size:13px;display:flex;align-items:center;justify-content:space-between}
header .title{font-weight:700}
header .meta{font-size:11px;opacity:.85}
#status{padding:4px 14px;font-size:11px;color:#666;background:#eef2f5;border-bottom:1px solid #e5e7eb}
#status.error{background:#fee2e2;color:#991b1b}
#status.ready{background:#dcfce7;color:#166534}
#chat{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px}
.msg{max-width:88%;padding:8px 12px;border-radius:10px;font-size:13px;line-height:1.6;white-space:pre-wrap;word-break:break-word}
.msg.user{align-self:flex-end;background:#4f779a;color:#fff;border-bottom-right-radius:2px}
.msg.bot{align-self:flex-start;background:#fff;border:1px solid #e5e7eb;border-bottom-left-radius:2px}
.msg.bot.error{background:#fee2e2;border-color:#fecaca;color:#991b1b}
.msg.bot.loading{color:#888;font-style:italic}
.msg .meta{font-size:10px;color:#aaa;margin-top:6px;text-align:right}
.msg.user .meta{color:#cfd9e3}
.msg strong{font-weight:700}
.msg code{background:rgba(0,0,0,.08);padding:1px 4px;border-radius:3px;font-size:11px}
.msg ul,.msg ol{margin:4px 0;padding-left:20px}

#input-area{border-top:1px solid #e5e7eb;padding:8px;background:#fff;display:flex;gap:6px}
#input-area textarea{flex:1;border:1px solid #cbd5e1;border-radius:6px;padding:6px 10px;font-size:13px;
  font-family:inherit;resize:none;outline:none;line-height:1.4;min-height:36px;max-height:96px}
#input-area textarea:focus{border-color:#4f779a}
#input-area button{background:#4f779a;color:#fff;border:none;border-radius:6px;padding:6px 14px;
  font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap}
#input-area button:hover{background:#3a5d7a}
#input-area button:disabled{background:#ccc;cursor:not-allowed}

#context-hint{padding:6px 14px;font-size:11px;color:#666;background:#fffaf0;border-bottom:1px solid #fde68a}
#context-hint .label{font-weight:700;color:#92400e}

#empty-hint{padding:20px;text-align:center;color:#999;font-size:12px}
#empty-hint b{color:#4f779a}
