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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  background: #f4f4f5;
  color: #18181b;
  min-height: 100vh;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: #18181b;
  color: #fff;
}
.brand { font-weight: 600; font-size: 15px; letter-spacing: -0.2px; }
.brand-sub { color: #a1a1aa; font-size: 12px; }

/* ── Layout ── */
main { padding: 20px; }
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Panels ── */
.panel {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  overflow: hidden;
}
.panel-left {
  display: flex;
  flex-direction: column;
}
.panel-right {
  padding: 24px;
  min-height: 400px;
}

/* ── Sections ── */
.section { padding: 16px 16px 0; }
.section:last-of-type { padding-bottom: 16px; }
.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #71717a;
  margin-bottom: 10px;
}

/* ── Fields ── */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field { display: flex; flex-direction: column; gap: 3px; }
.label { font-size: 11px; color: #71717a; font-weight: 500; }
.value { font-size: 13px; color: #18181b; line-height: 1.4; }
.mt-8 { margin-top: 8px; }

/* ── Select ── */
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #18181b;
  cursor: pointer;
  margin-top: 6px;
}
select:focus { outline: 2px solid #6366f1; outline-offset: 1px; }

/* ── Run button ── */
.run-bar {
  padding: 16px;
  border-top: 1px solid #f4f4f5;
  margin-top: auto;
}
button {
  width: 100%;
  padding: 10px;
  background: #18181b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover:not(:disabled) { background: #27272a; }
button:disabled { background: #a1a1aa; cursor: not-allowed; }
button.running { background: #6366f1; }

/* ── Right panel states ── */
.state-message { color: #71717a; padding: 40px 0; text-align: center; }
.error-title { font-weight: 600; color: #dc2626; margin-bottom: 8px; }
pre { font-size: 12px; color: #dc2626; white-space: pre-wrap; }

/* ── Agent labels ── */
.agent-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #71717a;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auto-badge {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Verdict header ── */
.verdict-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
}
.grade-wrap { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.grade-badge {
  width: 52px; height: 52px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  background: #f4f4f5; color: #18181b;
}
.grade-A { background: #f0fdf4; color: #15803d; }
.grade-B { background: #f0fdf4; color: #16a34a; }
.grade-C { background: #fefce8; color: #854d0e; }
.grade-D { background: #fff7ed; color: #c2410c; }
.grade-E, .grade-F { background: #fef2f2; color: #b91c1c; }

.tags-row { display: flex; flex-direction: column; gap: 8px; }
.tag-group { display: flex; align-items: center; gap: 8px; }
.tag-group .label { width: 72px; }

/* ── Tags ── */
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #f4f4f5;
  color: #52525b;
}
.fraud-clear    { background: #f0fdf4; color: #15803d; }
.fraud-flagged  { background: #fef2f2; color: #b91c1c; }
.disp-restock   { background: #eff6ff; color: #1d4ed8; }
.disp-resell    { background: #fefce8; color: #854d0e; }
.disp-liquidate { background: #fff7ed; color: #c2410c; }
.disp-reject    { background: #fef2f2; color: #b91c1c; }

.refund-triggered { background: #f0fdf4; color: #15803d; }
.refund-denied    { background: #fef2f2; color: #b91c1c; }
.refund-credit    { background: #eff6ff; color: #1d4ed8; }

.dest-primary     { background: #f0fdf4; color: #15803d; }
.dest-secondary   { background: #fefce8; color: #854d0e; }
.dest-offprice    { background: #fff7ed; color: #c2410c; }
.dest-liquidation { background: #fef2f2; color: #b91c1c; }
.dest-fraud       { background: #fdf4ff; color: #7e22ce; }
.dest-reject      { background: #fef2f2; color: #b91c1c; }

/* ── Reasoning ── */
.reasoning-box {
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}
.reasoning-text { margin-top: 6px; line-height: 1.6; color: #3f3f46; }

/* ── Blinking cursor ── */
.cursor {
  display: inline-block;
  width: 2px; height: 14px;
  background: #6366f1;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Fraud detail ── */
.fraud-detail {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #7f1d1d;
  line-height: 1.5;
}
.fraud-conf { margin-bottom: 4px; }

/* ── Agent 2 panel ── */
.agent2-panel {
  border-top: 1px solid #e4e4e7;
  margin-top: 24px;
  padding-top: 24px;
}
.spinner-row { display: flex; align-items: center; gap: 10px; color: #71717a; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid #e4e4e7;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.resolution-section { margin-bottom: 20px; }
.resolution-section .section-title { margin-bottom: 10px; }
.refund-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.refund-amount { font-size: 22px; font-weight: 700; color: #18181b; }
.muted { color: #71717a; line-height: 1.5; }

.notification-box {
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.6;
  color: #3f3f46;
}

/* ── Utilities ── */
.hidden { display: none !important; }
