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

/* Base */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  border-bottom: 1px solid #eee;
  padding: 14px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a56db;
  text-decoration: none;
}
.nav-tagline {
  font-size: 0.85rem;
  color: #888;
}

/* Hero */
.hero {
  padding: 80px 0 48px;
  text-align: center;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.hero h1 span { color: #1a56db; }
.hero .subtitle {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 8px;
}
.hero .oneliner {
  font-size: 1rem;
  color: #777;
  max-width: 560px;
  margin: 0 auto 28px;
}

/* Search box */
.search-box {
  max-width: 560px;
  margin: 0 auto 32px;
}
.search-box input {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus {
  border-color: #1a56db;
}

/* HTMX indicator */
.htmx-indicator {
  display: none;
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  padding: 12px 0;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: block;
}

/* Features grid */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; margin-bottom: 40px; }
.feature h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a56db;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.feature p { font-size: 0.92rem; color: #555; }

/* Stat callout */
.stat {
  background: #f7f9fc;
  border-left: 4px solid #1a56db;
  padding: 24px 28px;
  margin: 0 0 40px;
}
.stat p { font-size: 1.05rem; color: #333; }
.stat p strong { color: #1a56db; }

/* Section */
section { padding: 40px 0; }
section + section { border-top: 1px solid #eee; }

/* Search results */
.result-count {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 12px;
}
.result-card {
  display: block;
  padding: 14px 18px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.result-card:hover {
  border-color: #1a56db;
  background: #f7f9fc;
}
.result-card .name {
  font-weight: 600;
  font-size: 1rem;
  color: #1a1a1a;
}
.result-card .meta {
  font-size: 0.85rem;
  color: #888;
  margin-top: 2px;
}
.no-results {
  text-align: center;
  color: #888;
  padding: 24px 0;
}

/* Footer */
.footer {
  border-top: 1px solid #eee;
  padding: 24px 0;
  margin-top: 48px;
  text-align: center;
}
.footer p {
  font-size: 0.8rem;
  color: #999;
}

/* Responsive */
@media (max-width: 600px) {
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 1.8rem; }
  .features { grid-template-columns: 1fr; gap: 24px; }
  .stat { padding: 20px 20px; }
}

/* Dossier */
.dossier { padding: 32px 0; }

.dossier-header { margin-bottom: 32px; }
.dossier-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.88rem;
  color: #666;
}
.meta-bar span { white-space: nowrap; }
.meta-bar span + span::before { content: "\00b7"; margin-right: 16px; color: #ccc; display: none; }

.dossier-section {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid #eee;
}
.dossier-section:last-child { border-bottom: none; }
.dossier-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1a56db;
  margin-bottom: 16px;
}

/* PSC list */
.psc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.psc-list li { font-size: 0.95rem; }
.psc-detail {
  color: #888;
  font-size: 0.85rem;
  margin-left: 8px;
}

/* Score card */
.score-card { margin-top: 8px; }
.score-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.signal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.signal-list li {
  font-size: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.signal-name { font-weight: 600; color: #333; }
.signal-value { color: #dc3545; font-weight: 600; font-size: 0.85rem; }
.signal-detail { color: #888; font-size: 0.85rem; }

/* Graph */
#graph-container {
  height: 400px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ddd;
}

.timeline-event {
  position: relative;
  padding-bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.timeline-event::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a56db;
}

.timeline-date {
  flex-shrink: 0;
  width: 90px;
  font-size: 0.82rem;
  color: #888;
  font-weight: 600;
}

.timeline-content { font-size: 0.92rem; }
.timeline-badge {
  display: inline-block;
  background: #f0f4ff;
  color: #1a56db;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 6px;
}
.timeline-desc { color: #333; }
.timeline-source {
  display: block;
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 2px;
}

/* Brief button */
.btn-brief {
  background: #1a56db;
  color: #fff;
  border: none;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-brief:hover { background: #1544b5; }

/* Empty state */
.empty-state {
  color: #999;
  font-style: italic;
  font-size: 0.92rem;
  padding: 12px 0;
}

/* Score badge colours */
.score-badge.high { background: #dc3545; }
.score-badge.medium { background: #f59e0b; }
.score-badge.low { background: #22c55e; }
.score-badge.unknown { background: #888; }

/* Address in dossier header */
.dossier-header .address {
  font-size: 0.88rem;
  color: #666;
  margin-top: 8px;
}

/* Brief loading + spinner */
.brief-loading {
  text-align: center;
  padding: 32px 0;
  color: #666;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: #1a56db;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Brief narrative */
.brief-narrative p {
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.7;
}
.brief-structured h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.brief-structured h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a56db;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.brief-section {
  margin-bottom: 20px;
}
.brief-section ul {
  list-style: none;
  padding: 0;
}
.brief-section li {
  font-size: 0.92rem;
  color: #444;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
}
.brief-signal {
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.brief-person {
  font-size: 0.92rem;
  padding: 4px 0;
}
.person-companies {
  color: #888;
  font-size: 0.85rem;
  margin-left: 4px;
}

/* Error */
.error {
  color: #dc3545;
  font-weight: 600;
  padding: 12px 0;
}
