:root {
  color-scheme: dark;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #020617;
  color: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% -10%, rgba(14, 165, 233, 0.25), transparent 35%),
              radial-gradient(circle at 90% 0%, rgba(34, 197, 94, 0.18), transparent 25%),
              radial-gradient(circle at 50% 100%, rgba(251, 191, 36, 0.12), transparent 35%),
              #020617;
}

.hero {
  padding: 2rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), transparent);
}

.hero-copy {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.25rem 0;
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 0.5rem;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.02;
  max-width: 780px;
}

.subtitle {
  margin: 0.75rem 0 0;
  color: #94a3b8;
  max-width: 680px;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.panel {
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.92), rgba(12, 22, 36, 0.8));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 22px 70px rgba(7, 12, 20, 0.35);
  backdrop-filter: blur(10px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results-header {
  flex-wrap: wrap;
}

.results-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}


.grid-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.analyst-fieldset {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem 1rem 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.68);
}

.analyst-fieldset legend {
  padding: 0 0.35rem;
  margin-left: -0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.analyst-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-direction: row;
  padding: 0.7rem 0.8rem;
  margin-top: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.26);
  cursor: pointer;
}

.analyst-option input[type="checkbox"] {
  appearance: auto;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #38bdf8;
  margin: 0;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.analyst-select-all {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.22);
}

.analyst-option span {
  color: #e2e8f0;
  font-weight: 600;
}

.depth-fieldset {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem 1rem 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.68);
}

.depth-fieldset legend {
  padding: 0 0.35rem;
  margin-left: -0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.depth-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-direction: row;
  padding: 0.7rem 0.8rem;
  margin-top: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.26);
  cursor: pointer;
}

.depth-option input[type="radio"] {
  appearance: auto;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #38bdf8;
  margin-top: 0.2rem;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.depth-option span {
  color: #cbd5e1;
  line-height: 1.45;
}

.depth-option strong {
  color: #f8fafc;
}

.effort-fieldset {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem 1rem 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.68);
}

.effort-fieldset legend {
  padding: 0 0.35rem;
  margin-left: -0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.effort-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-direction: row;
  padding: 0.7rem 0.8rem;
  margin-top: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.26);
  cursor: pointer;
}

.effort-option input[type="radio"] {
  appearance: auto;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #38bdf8;
  margin-top: 0.2rem;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.effort-option span {
  color: #cbd5e1;
  line-height: 1.45;
}

.effort-option strong {
  color: #f8fafc;
}

input,
select,
button {
  border-radius: 14px;
}

input:not([type="radio"]):not([type="checkbox"]),
select {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  padding: 0.95rem 1rem;
  min-height: 48px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input:not([type="radio"]):not([type="checkbox"]):focus,
select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.depth-option:has(input:checked),
.effort-option:has(input:checked),
.analyst-option:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(8, 47, 73, 0.5);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.14);
}

.depth-option:focus-within,
.effort-option:focus-within,
.analyst-option:focus-within {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

button {
  border: none;
  padding: 0.95rem 1.15rem;
  min-height: 48px;
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  background: linear-gradient(120deg, #38bdf8, #22d3ee);
  color: #02121c;
}

button.primary:hover {
  background: linear-gradient(120deg, #0ea5e9, #14b8a6);
}

button.secondary {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}

button.secondary:hover {
  background: rgba(148, 163, 184, 0.2);
}

.status {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.95);
  color: #cbd5e1;
}

.status.success {
  border-color: rgba(52, 211, 153, 0.4);
  color: #86efac;
}

.status.error {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.result-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(320px, 1fr);
}

.result-card {
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(17, 29, 46, 0.88));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  padding: 1rem;
  min-height: 280px;
}

.result-card h3 {
  margin-top: 0;
  color: #f8fafc;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.kpi-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: rgba(15, 23, 42, 0.72);
}

.kpi-card-reasoning {
  grid-column: 1 / -1;
}

.kpi-label {
  color: #94a3b8;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.kpi-value {
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
}

.kpi-value-reasoning {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  max-height: 4.05em;
  font-size: 0.92rem;
}

.selection-summary,
.highlights {
  margin-top: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  padding: 0.9rem;
}

.selection-summary h4,
.highlights h4 {
  margin: 0 0 0.65rem;
  color: #7dd3fc;
  font-size: 0.9rem;
}

.selection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selection-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  background: rgba(56, 189, 248, 0.1);
  color: #e0f2fe;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.highlights ul {
  margin: 0;
  padding-left: 1.15rem;
  color: #cbd5e1;
}

.highlights li {
  margin: 0.35rem 0;
}

.report-section {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.report-section:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.report-section h5 {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f8fafc;
}

.report-section-body {
  color: #cbd5e1;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.viz-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0.75rem;
}

.viz-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.75), rgba(22, 36, 56, 0.6));
  padding: 0.8rem;
}

.viz-card h4 {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: #7dd3fc;
}

.action-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.gauge-ring {
  --gauge-value: 50;
  --gauge-color: #38bdf8;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--gauge-color) calc(var(--gauge-value) * 1%), rgba(148, 163, 184, 0.18) 0);
  position: relative;
  display: grid;
  place-items: center;
}

.gauge-buy {
  --gauge-color: #22c55e;
}

.gauge-sell {
  --gauge-color: #f43f5e;
}

.gauge-hold,
.gauge-unknown {
  --gauge-color: #f59e0b;
}

.gauge-ring::after {
  content: '';
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.gauge-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.gauge-score {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc;
}

.gauge-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gauge-action {
  font-size: 0.85rem;
}

.gauge-caption {
  font-size: 0.74rem;
  color: #94a3b8;
  text-align: center;
}

.message-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.timeline-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(4px);
  animation: timeline-in 0.35s ease forwards;
  animation-delay: calc(var(--stagger) * 45ms);
}

.timeline-index {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.timeline-body {
  flex: 1;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  padding-left: 0.65rem;
}

.timeline-role {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f8fafc;
  margin-bottom: 0.2rem;
}

.timeline-preview {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.35;
}

.json-metrics {
  margin-top: 0.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.json-metric-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.json-metric-bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  margin-top: 0.25rem;
}

.json-metric-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, #38bdf8, #22d3ee);
}

.json-metric-card span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.json-metric-card strong {
  font-size: 1rem;
  color: #f8fafc;
}

.json-structure {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.json-structure-item {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  padding: 0.6rem 0.7rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.json-structure-item:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.38);
}

.json-structure-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.json-key {
  color: #f8fafc;
  font-size: 0.86rem;
  font-weight: 600;
}

.json-type {
  font-size: 0.7rem;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  text-transform: uppercase;
}

.json-type-object { border-color: rgba(56, 189, 248, 0.5); color: #7dd3fc; }
.json-type-array { border-color: rgba(167, 139, 250, 0.5); color: #c4b5fd; }
.json-type-string { border-color: rgba(52, 211, 153, 0.5); color: #6ee7b7; }
.json-type-number { border-color: rgba(251, 191, 36, 0.5); color: #fcd34d; }
.json-type-boolean { border-color: rgba(244, 114, 182, 0.5); color: #f9a8d4; }
.json-type-null { border-color: rgba(148, 163, 184, 0.5); color: #cbd5e1; }

.json-summary {
  margin-top: 0.35rem;
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-word;
}

.reportContent,
.rawOutput {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  white-space: pre-wrap;
  min-height: 180px;
  overflow: auto;
}

.summary-block {
  margin-bottom: 1rem;
}

.summary-block strong {
  display: block;
  margin-bottom: 0.5rem;
  color: #7dd3fc;
}

.footer {
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
  color: #94a3b8;
  font-size: 0.95rem;
}

@keyframes timeline-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

code {
  background: rgba(148, 163, 184, 0.12);
  padding: 0.15rem 0.35rem;
  border-radius: 0.45rem;
}

@media (max-width: 760px) {
  .result-grid {
    grid-template-columns: 1fr;
  }

  .results-actions {
    width: 100%;
  }

  .results-actions button {
    flex: 1;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .viz-grid {
    grid-template-columns: 1fr;
  }
}
