* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #1e293b;
}
h1 { font-size: 16px; margin: 0; }
.header-actions { display: flex; gap: 6px; }
button.ghost {
  background: transparent;
  border: 1px solid #334155;
  color: #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
}
.settings-panel {
  padding: 14px 16px;
  border-bottom: 1px solid #1e293b;
  background: #111827;
}
.settings-panel label { display: block; font-size: 12.5px; color: #94a3b8; margin-bottom: 6px; }
.settings-panel input {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.settings-panel .hint { font-size: 12px; color: #64748b; margin: 10px 0; line-height: 1.5; }
.settings-panel button {
  background: #f97316; color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.msg { max-width: 85%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: #f97316; color: #fff; border-bottom-right-radius: 3px; }
.msg.assistant { align-self: flex-start; background: #1e293b; color: #e2e8f0; border-bottom-left-radius: 3px; }
.msg.status { align-self: center; color: #64748b; font-size: 12.5px; font-style: italic; background: none; }
.msg.error { align-self: center; color: #f87171; background: #1f1315; border: 1px solid #7c2d12; }
.msg.tool { align-self: flex-start; background: #0b2a2a; color: #99f6e4; border: 1px solid #134e4a; font-size: 13px; }
.tool-results table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12.5px; }
.tool-results th, .tool-results td { text-align: left; padding: 3px 6px; border-bottom: 1px solid #134e4a; }
.tool-results a { color: #5eead4; }
#composer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #1e293b;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
#userInput {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
}
#userInput:focus { outline: none; border-color: #f97316; }
#composer button {
  background: #f97316; color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
}
#composer button:disabled { opacity: 0.5; cursor: default; }
.account { font-size: 12.5px; color: #94a3b8; align-self: center; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-panel input + input { display: block; }
