:root {
  --bg: #f0ede6;
  --bg-card: #ffffff;
  --text: #1c1917;
  --text-muted: #57534e;
  --border: #e7e5e4;
  --accent: #1e3a5f;
  --accent-light: #2d4a73;
  --gold: #b8860b;
  --gold-soft: rgba(184, 134, 11, 0.12);
  --success: #0d9488;
  --shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  --radius: 14px;
  --font: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(240, 237, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}

/* LeadConnector <chat-widget>: move from default bottom to top-right */
chat-widget {
  position: fixed !important;
  top: 4.35rem !important;
  right: 1rem !important;
  bottom: auto !important;
  left: auto !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 60 !important;
}

@media (max-width: 480px) {
  chat-widget {
    top: 4rem !important;
    right: 0.65rem !important;
    max-width: calc(100vw - 1.25rem);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #2c5282 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.brand__tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--accent);
  border: 1px solid rgba(30, 58, 95, 0.15);
}

/* Hero */
.hero {
  padding: 2.25rem 0 1.5rem;
}

.hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin: 0 0 0.5rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  max-width: 32ch;
}

.hero__lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 52ch;
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.75rem;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  background: radial-gradient(circle at top right, var(--gold-soft), transparent 70%);
  pointer-events: none;
}

.kpi-card__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.35rem;
}

.kpi-card__value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.kpi-card__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

/* Section */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2.25rem 0 1rem;
  letter-spacing: -0.02em;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.chart-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chart-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.chart-card__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.chart-wrap--tall {
  height: 300px;
}

/* Table */
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead {
  position: sticky;
  top: 0;
  background: #fafaf9;
  z-index: 1;
  box-shadow: 0 1px 0 var(--border);
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: rgba(30, 58, 95, 0.04);
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Loading / error */
.state-banner {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.state-banner--error {
  color: #b91c1c;
}

/* Chat hint */
.chat-hint {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.chat-hint__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.chat-hint h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.chat-hint p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.92;
  max-width: 60ch;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

