body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #0f172a;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.card {
  background: #020617;
  border-radius: 16px;
  padding: 20px 24px 18px 24px;
  max-width:  min(1200px, 96vw);
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(15,23,42,0.8);
  border: 1px solid #1f2937;
  display: flex;
  flex-direction: column;
}
h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 10px;
}
.chat-window {
  flex: 1;
  border-radius: 12px;
  border: 1px solid #1e293b;
  padding: 12px;
  background: radial-gradient(circle at top left, rgba(34,197,94,0.08), transparent 55%), #020617;
  overflow-y: auto;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.bubble {
  max-width: 95%;
  padding: 8px 10px;
  border-radius: 12px;
  margin-bottom: 6px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.bubble.user {
  margin-left: auto;
  background: #22c55e;
  color: #022c22;
  border-bottom-right-radius: 4px;
}
.bubble.assistant {
  margin-right: auto;
  background: #020617;
  border: 1px solid #1f2937;
  border-bottom-left-radius: 4px;
  word-break: break-word;
  overflow-wrap: break-word;
}
.bubble.assistant a, .bubble .bubble-link {
  color: #4ade80;
  text-decoration: underline;
}
.bubble.assistant a:hover, .bubble .bubble-link:hover {
  color: #86efac;
}
.bubble.assistant.security-blocked {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), #020617);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}
.security-strip {
  font-size: 0.85rem;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.security-strip strong {
  color: #fbbf24;
}
.input-row {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
textarea {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #374151;
  padding: 10px 12px;
  background: #020617;
  color: #e5e7eb;
  outline: none;
  font: inherit;
}
textarea:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.4);
}
button {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(to right, #22c55e, #4ade80);
  color: #022c22;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
  flex-wrap: wrap;
}
.image-drop-zone {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px dashed #1f2937;
  background: rgba(15,23,42,0.7);
  cursor: pointer;
  min-width: 260px;
}
.image-drop-zone.drag-over {
  border-color: #22c55e;
  background: rgba(15,23,42,0.95);
}
.image-drop-hint {
  font-size: 0.7rem;
  color: #9ca3af;
}
.status {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 6px;
  min-height: 1.2em;
}
.footer {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #6b7280;
}
a {
  color: #22c55e;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.pill, .pill-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #1f2937;
  color: #9ca3af;
  cursor: pointer;
}
.pill-secondary {
  background: transparent;
  border-color: #374151;
}
.pill strong {
  color: #e5e7eb;
}
.pill input[type="file"] {
  display: none;
}
.pill span.filename {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 6px;
}
.product-card {
  width: 140px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.product-card img,
.product-card .card-img-placeholder {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: #1e293b;
  display: block;
}
.product-card .card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #64748b;
}
.product-card .card-body {
  padding: 8px 10px;
}
.product-card .card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e5e7eb;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.product-card .card-price {
  font-size: 0.85rem;
  color: #4ade80;
  margin-top: 4px;
}
.product-card a {
  font-size: 0.75rem;
  margin-top: 4px;
  display: inline-block;
}
.product-cards-wrap {
  max-width: 95%;
  margin-right: auto;
  margin-bottom: 6px;
}

.comparison-section {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  padding: 10px 12px;
  background: #020617;
}
.comparison-section.hidden {
  display: none;
}
.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.comparison-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e5e7eb;
}
.pill-secondary.small {
  padding: 4px 10px;
  font-size: 0.7rem;
}
.comparison-table {
  width: 100%;
  overflow-x: auto;
}
.comparison-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  gap: 10px;
}
.comparison-col {
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 8px;
  background: #020617;
}
.comparison-col-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.comparison-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.comparison-tag.best_overall {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
}
.comparison-tag.budget_pick {
  background: rgba(59,130,246,0.12);
  color: #93c5fd;
}
.comparison-tag.value_pick {
  background: rgba(45,212,191,0.12);
  color: #99f6e4;
}
.comparison-tag.balanced_pick {
  background: rgba(250,204,21,0.12);
  color: #fde68a;
}
.comparison-tag.premium_pick {
  background: rgba(244,114,182,0.12);
  color: #f9a8d4;
}
.comparison-row-label {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 4px;
}
.comparison-row-value {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.comparison-summary {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.trace-section {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  padding: 10px 12px;
  background: #020617;
}

.trace-section.hidden {
  display: none;
}

.trace-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.75rem;
  color: #cbd5e1;
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 8px;
}

.session-input {
  width: 100px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.75rem;
}

#compareModeToggle.active {
  border-color: #22c55e;
  color: #86efac;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.25) inset;
}

.mode-state {
  font-size: 0.75rem;
  border: 1px solid #374151;
  border-radius: 999px;
  padding: 4px 8px;
}

.mode-state.on {
  color: #86efac;
  border-color: #22c55e;
}

.mode-state.off {
  color: #9ca3af;
}

#budgetModeToggle.active {
  border-color: #f59e0b;
  color: #fde68a;
  box-shadow: 0 0 0 1px rgba(245,158,11,0.25) inset;
}

