.btn {
  padding: 10px 14px; border: 1px solid var(--line2); border-radius: 8px;
  background: rgba(255,255,255,.02); color: var(--text); white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04110c; font-weight: 700; }
.btn-primary:hover { background: var(--accent2); color: #04110c; }
.btn-danger { color: var(--bad); border-color: rgba(255,107,122,.35); }
.mini { padding: 7px 10px; font-size: .78rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted2); }
.status-dot.good { background: var(--good); box-shadow: 0 0 12px rgba(96,224,162,.5); }
.status-dot.bad { background: var(--bad); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span {
  color: var(--muted2); font: .68rem var(--mono);
  text-transform: uppercase; letter-spacing: .12em;
}
input, textarea {
  width: 100%; min-width: 0; padding: 11px 12px;
  border: 1px solid var(--line2); border-radius: 8px;
  background: #0b1018; color: var(--text); outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.tool-panel {
  display: grid; align-content: start; gap: 12px;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.015);
}
.tool-panel h3, .table-head h3 { margin: 0; font-size: .88rem; }
.upload-zone {
  display: grid; place-items: center; gap: 7px; min-height: 165px;
  padding: 20px; border: 1px dashed var(--line2); border-radius: 8px;
  color: var(--text); text-align: center; background: rgba(124,243,198,.025);
}
.upload-zone span, .file-name { color: var(--muted); font-size: .8rem; }
.upload-zone input { display: none; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 16px 0 10px; }
.results-list, .document-list { display: grid; gap: 8px; }
.result, .document {
  padding: 12px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255,255,255,.015);
}
.result-head, .document-head, .table-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.table-head { margin: 18px 0 10px; }
.source-chip {
  display: inline-flex; padding: 4px 7px; border: 1px solid var(--line2);
  border-radius: 999px; color: var(--accent); font: .68rem var(--mono);
}
.result p, .document p { margin: 8px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.product-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.product {
  min-width: 0; padding: 14px; border: 1px solid var(--line);
  border-radius: 8px; background: rgba(255,255,255,.015);
}
.product strong { display: block; margin-bottom: 7px; }
.product span { color: var(--muted); font-size: .8rem; }
.chat-log {
  height: 430px; overflow: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #0a0e15;
}
.message { max-width: 88%; padding: 10px 12px; border-radius: 10px; line-height: 1.5; font-size: .86rem; white-space: pre-wrap; }
.message.assistant { align-self: flex-start; background: var(--bg3); }
.message.user { align-self: flex-end; background: var(--accent); color: #04110c; }
.message-action {
  display: inline-flex; margin-top: 9px; padding: 7px 9px;
  border: 1px solid var(--accent); border-radius: 7px;
  color: var(--accent); text-decoration: none; font-weight: 700;
}
.message-action:hover { background: var(--accent); color: #04110c; }
.chat-form { display: grid; gap: 8px; margin-top: 10px; }
.chat-form textarea { min-height: 80px; }
.code-box {
  padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 8px;
  background: #0a0e15; color: var(--accent); white-space: pre-wrap; word-break: break-all;
}
.empty { padding: 22px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
@media (max-width: 720px) {
  .search-row, .product-grid { grid-template-columns: 1fr; }
}
