body{margin:0;font-family:system-ui,sans-serif;background:#0f172a;color:#e2e8f0}
.page-simple{min-height:100vh}
.content{
  padding:12px;
  display:grid;
  gap:12px;
  width:100%;
  max-width:none;
  margin:0;
}

.page-header{margin-bottom:8px}
.page-header h1{margin:0;font-size:32px}
.panel{
  background:#111827;
  border:1px solid #334155;
  border-radius:16px;
  padding:12px;
}
.chat-panel{
  padding:0;
  border:none;
  background:transparent;
}
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.choice-card{padding:14px;border-radius:14px;border:1px solid #475569;background:#0f172a;color:#e2e8f0;text-align:left;cursor:pointer}
.choice-card.selected{outline:2px solid #38bdf8}
.choice-title{font-weight:700;margin-bottom:6px}
.choice-subtitle,.muted{color:#94a3b8;font-size:14px}
.form-grid{display:grid;gap:12px}
.field{display:grid;gap:6px}
input{padding:10px 12px;border-radius:10px;border:1px solid #475569;background:#0f172a;color:#e2e8f0}
.primary-btn{margin-top:14px;padding:12px 16px;border-radius:12px;border:none;background:#0284c7;color:white;cursor:pointer}
.code-block{white-space:pre-wrap;word-break:break-word;background:#020617;padding:12px;border-radius:12px;border:1px solid #334155}
.result-block{margin-top:12px}
.result-label{font-weight:700;margin-bottom:6px}

.chat-shell {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 16px;
  overflow: hidden;
}

.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid #334155;
  background: #111827;
}

.chat-title {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
}

.chat-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #94a3b8;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0f172a;
}

.chat-footer {
  padding: 14px 16px;
  border-top: 1px solid #334155;
  background: #111827;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.chat-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
}

.message {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 16px;
  white-space: normal;
  line-height: 1.5;
  word-break: break-word;
}

.user-message {
  align-self: flex-end;
  background: #dbeafe;
  color: #0f172a;
  border-bottom-right-radius: 4px;
}

.assistant-message {
  align-self: flex-start;
  background: #f8fafc;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}

.agent-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.message-content p {
  margin: 0 0 10px 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul,
.message-content ol {
  margin: 8px 0 8px 20px;
  padding: 0;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.95em;
}

.message-content pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #e2e8f0;
  padding: 10px;
  border-radius: 10px;
  overflow-x: auto;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  font-size: 14px;
}

.message-content th,
.message-content td {
  border: 1px solid #cbd5e1;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.message-content th {
  background: #e2e8f0;
  font-weight: 700;
}

.message-content tr:nth-child(even) {
  background: #f8fafc;
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #0284c7;
  color: white;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chat-send-btn:hover {
  background: #0369a1;
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-footer-top {
  border-top: none;
  border-bottom: 1px solid #334155;
}

.hidden {
  display: none;
}

.submit-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-send-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-loader {
  width: 22px;
  height: 22px;
  border: 3px solid #475569;
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.primary-btn:disabled,
.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .content {
    padding: 8px;
    gap: 10px;
  }

  .panel {
    padding: 10px;
    border-radius: 12px;
  }

  .chat-header,
  .chat-footer,
  .chat-body {
    padding: 10px;
  }

  .chat-body {
    gap: 10px;
  }

  .page-header h1 {
    font-size: 24px;
  }
}