:root {
  --navy: #12294a;
  --navy-dark: #0c1c33;
  --gold: #b8860b;
  --gold-light: #d4a72c;
  --ink: #1d2433;
  --muted: #5b6474;
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e3e7ee;
  --error: #b00020;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--navy);
  color: #fff;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--gold); color: var(--navy);
  font-weight: 800; letter-spacing: .5px;
}
.logo-text { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.logo-text small { display: block; font-weight: 400; font-size: .72rem; color: #c8d2e2; }
.demo-pill {
  font-size: .75rem; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  border: 1px solid var(--gold); color: var(--gold-light);
  padding: 4px 10px; border-radius: 999px;
}

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 32px 20px 64px; }
.hero { text-align: center; margin: 24px 0 36px; }
.hero-sm { margin: 8px 0 28px; }
.hero h1 { font-size: 2rem; margin: 0 0 8px; color: var(--navy); }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 560px; }
.timing { color: var(--gold); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(18, 41, 74, .06);
}

/* Demo hub */
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.demo-card { text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.demo-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(18, 41, 74, .12); }
.demo-card h3 { margin: 0 0 8px; color: var(--navy); }
.demo-card p { color: var(--muted); font-size: .93rem; }
.card-cta { color: var(--gold); font-weight: 600; font-size: .9rem; }

/* Form */
.intake-form { max-width: 720px; margin: 0 auto; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 6px; margin: 0 0 18px; }
legend { font-weight: 700; color: var(--navy); padding: 0 8px; font-size: .95rem; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 18px; }
.field { margin-bottom: 14px; display: flex; flex-direction: column; }
label { font-weight: 600; font-size: .85rem; margin-bottom: 5px; color: var(--ink); }
input, select, textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: .95rem; background: #fff; color: var(--ink);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.error { color: var(--error); font-size: .8rem; margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 8px; border: 0;
  font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  text-align: center;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-light); color: var(--navy); }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-big { width: 100%; padding: 15px; font-size: 1.05rem; }
.btn[disabled] { opacity: .65; cursor: wait; }

.fine-print { font-size: .75rem; color: var(--muted); text-align: center; margin-top: 12px; }

/* Result page */
.result-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; }
@media (max-width: 720px) { .result-grid { grid-template-columns: 1fr; } }
.letter-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.doc-icon {
  width: 64px; height: 76px; border-radius: 8px;
  background: var(--navy); color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8rem; letter-spacing: 1px;
  border-bottom: 4px solid var(--gold);
}
.letter-card h3, .behind-card h3 { margin: 0; color: var(--navy); }
.behind-list { list-style: none; padding: 0; margin: 16px 0 8px; }
.behind-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.behind-list li:last-child { border-bottom: 0; }
.check {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: #e8f5ec; color: #1a7f3c; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.behind-list strong { color: var(--navy); }
.behind-list p { margin: 3px 0 0; font-size: .88rem; }
.stage-pill {
  background: var(--gold); color: #fff; font-size: .75rem; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
}
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.actions-row { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* CTA footer */
.cta-footer { background: var(--navy); color: #fff; padding: 36px 24px 20px; margin-top: 40px; }
.cta-inner {
  max-width: 960px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-inner h2 { margin: 0 0 6px; font-size: 1.35rem; }
.cta-inner p { margin: 0; color: #c8d2e2; max-width: 540px; font-size: .95rem; }
.footer-line { text-align: center; color: #8fa0ba; font-size: .78rem; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; max-width: 960px; margin: 0 auto; }

/* Demo hub badges */
.brand-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  background: #0d9488; color: #fff; padding: 2px 8px; border-radius: 999px;
  vertical-align: middle; margin-left: 6px;
}

/* --- doc_summarizer --- */
.upload-error { text-align: center; font-size: .9rem; margin: 0 0 14px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 2px dashed var(--line); border-radius: 12px; padding: 32px 20px;
  cursor: pointer; text-align: center; margin-bottom: 18px;
  transition: border-color .12s ease, background .12s ease;
}
.dropzone:hover { border-color: var(--gold); background: #fbfbf7; }
.doc-icon-sm { width: 46px; height: 56px; font-size: .65rem; }
.privacy-note {
  border-left: 4px solid var(--gold); background: var(--bg);
  border-radius: 0 8px 8px 0; padding: 12px 16px; margin-top: 18px;
}
.privacy-note strong { color: var(--navy); font-size: .9rem; }
.privacy-note p { margin: 4px 0 0; }
.samples { margin-top: 36px; }
.samples-title { text-align: center; color: var(--navy); margin-bottom: 16px; }
.sample-card { display: flex; flex-direction: column; gap: 8px; }
.sample-card h3 { margin: 0; color: var(--navy); }
.sample-card p { margin: 0; font-size: .9rem; }
.sample-card .btn { margin-top: 8px; }

.summary-card { margin-bottom: 20px; }
.summary-card h3 { margin: 0 0 10px; color: var(--navy); }
.source-pill {
  font-size: .68rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 999px; vertical-align: middle; margin-left: 8px;
}
.count-chip {
  font-size: .72rem; font-weight: 700; background: var(--navy); color: #fff;
  padding: 2px 9px; border-radius: 999px; vertical-align: middle; margin-left: 6px;
}
.actions-left { justify-content: flex-start; margin-top: 14px; }
.analysis-grid { align-items: start; }
.section-gap { margin-top: 20px; }

.timeline { list-style: none; margin: 14px 0 0; padding: 0 0 0 6px; }
.timeline li {
  position: relative; padding: 0 0 18px 22px;
  border-left: 2px solid var(--line);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -7px; top: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--gold); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline strong { color: var(--navy); font-size: .92rem; }
.timeline p { margin: 2px 0 0; }

.entity-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .9rem; }
.entity-table th {
  text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line);
}
.entity-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.entity-table tr:last-child td { border-bottom: 0; }
.mention-count { font-weight: 700; color: var(--navy); text-align: center; }

.topic-list { list-style: none; padding: 0; margin: 10px 0 0; }
.topic-list li { margin-bottom: 12px; }
.topic-row { display: flex; justify-content: space-between; align-items: center; }
.topic-row strong { color: var(--navy); font-size: .9rem; }
.topic-bar { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; margin: 4px 0 2px; }
.topic-bar span { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.topic-list p { margin: 0; }

.qa-block { border-left: 3px solid var(--line); padding: 4px 0 4px 14px; margin: 12px 0; }
.qa-q { margin: 0 0 4px; color: var(--navy); }
.qa-a { margin: 0; font-size: .92rem; }

.flag-list { list-style: none; padding: 0; margin: 12px 0 0; }
.flag-list li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.flag-list li:last-child { border-bottom: 0; }
.flag-pill {
  display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; background: #fdeef0; color: var(--error);
  padding: 2px 8px; border-radius: 999px; margin-right: 8px;
}

/* --- contract_checker --- */
.review-banner {
  max-width: 720px; margin: 0 auto 20px; text-align: center;
  background: #fdeef0; color: var(--error); border: 1px solid #f3c6cd;
  border-radius: 8px; padding: 8px 14px;
  font-size: .78rem; font-weight: 700; letter-spacing: .3px;
}
.doc-type-field { margin: 0 0 16px; }
.kpi-bad { color: var(--error) !important; }
.kpi-warn { color: #9a6b00 !important; }
.risk-head { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.risk-head strong { color: var(--navy); }
.risk-quote {
  margin: 8px 0 6px; padding: 6px 12px; border-left: 3px solid var(--line);
  color: var(--ink); font-size: .88rem; font-style: italic;
}
.row-muted td { color: var(--muted); opacity: .75; }

/* --- speed_to_lead --- */
.stl-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 760px) { .stl-grid { grid-template-columns: 1fr; } }
.webhook-box {
  background: var(--navy); color: #d8e2f0; border-radius: 10px;
  padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem; overflow-x: auto; white-space: pre; margin: 10px 0 0;
}
.webhook-box .wb-accent { color: var(--gold-light); }

.chip {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .3px;
  padding: 3px 10px; border-radius: 999px; text-transform: uppercase;
}
.chip-area { background: #e9eef7; color: var(--navy); }
.chip-high { background: #fdeef0; color: var(--error); }
.chip-medium { background: #fdf3e0; color: #9a6b00; }
.chip-low { background: #e8f5ec; color: #1a7f3c; }
.chip-premium { background: var(--gold); color: #fff; }
.chip-standard { background: #e9eef7; color: var(--navy); }
.chip-ok { background: #e8f5ec; color: #1a7f3c; }
.chip-warn { background: #fdf3e0; color: #9a6b00; }
.chip-late { background: #fdeef0; color: var(--error); }

.route-card h3 { margin: 0 0 6px; color: var(--navy); }
.sla-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 2.4rem; font-weight: 700; color: var(--navy); line-height: 1.1;
}
.sla-clock.sla-late { color: var(--error); }
.sla-sub { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }

.escalation { list-style: none; padding: 0; margin: 16px 0 0; }
.escalation li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.escalation li:last-child { border-bottom: 0; }
.esc-step {
  flex: 0 0 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8rem;
  background: var(--bg); color: var(--muted); border: 2px solid var(--line);
}
.esc-active .esc-step { background: var(--gold); color: #fff; border-color: var(--gold); }
.esc-done .esc-step { background: #e8f5ec; color: #1a7f3c; border-color: #1a7f3c; }
.escalation strong { color: var(--navy); }
.escalation .muted { font-size: .82rem; }

.lead-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.lead-table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line);
}
.lead-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lead-table tr:last-child td { border-bottom: 0; }
.lead-table a { color: var(--navy); font-weight: 600; }
.lead-msg { color: var(--muted); font-size: .82rem; max-width: 260px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { text-align: center; padding: 16px 10px; }
.kpi .kpi-num { font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.kpi .kpi-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
