:root {
  --bg: #f5f3ee;
  --surface: #fffdfa;
  --surface-muted: #ebe7dd;
  --ink: #252823;
  --muted: #6c7168;
  --line: #d8d2c5;
  --line-strong: #b9b19f;
  --slate: #35525a;
  --green: #446a4b;
  --amber: #9b7332;
  --blue: #345f88;
  --gray: #72746e;
  --shadow: 0 18px 45px rgba(33, 36, 31, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(37, 40, 35, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 40, 35, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.site-header,
.top-nav,
.timeline-panel,
.proof-strip,
.about-panel,
.page,
.site-footer {
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.92);
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.site-header h1,
.page-heading h2,
.summary-panel h3,
.section-header h3,
.work-card h4 {
  margin: 0;
  letter-spacing: 0;
}

.site-header h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.doctrine {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--slate);
  font-size: 1.05rem;
  font-weight: 700;
}

.header-context {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow,
.panel-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trail-chip {
  min-width: 230px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.chip-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 0;
}

.nav-link,
.filter-button,
.ghost-button,
.primary-button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}

.nav-link {
  flex: 1 1 150px;
  padding: 9px 12px;
  font-weight: 700;
}

.nav-link.active,
.filter-button.active {
  border-color: var(--slate);
  background: var(--slate);
  color: #fff;
}

.timeline-panel {
  padding: 16px 18px;
  border-top: 0;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 4%;
  right: 4%;
  height: 1px;
  background: var(--line-strong);
}

.timeline-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.stage-dot {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  z-index: 1;
}

.timeline-stage.complete .stage-dot {
  border-color: var(--green);
  background: var(--green);
}

.timeline-stage.current {
  color: var(--ink);
}

.timeline-stage.current .stage-dot {
  border-color: var(--slate);
  background: var(--surface);
  box-shadow: inset 0 0 0 5px var(--slate);
}

.proof-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-top: 0;
}

.proof-strip span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.about-panel {
  padding: 16px 18px;
  border-top: 0;
}

.about-panel p:last-child {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
}

.page {
  display: none;
  min-height: 620px;
  padding: 24px;
  border-top: 0;
}

.page.active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-heading h2 {
  max-width: 760px;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.page-heading p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.instruction-box {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid rgba(52, 95, 136, 0.24);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #f1f5f6;
}

.instruction-box strong {
  display: block;
  margin-bottom: 4px;
}

.instruction-box p,
.component-note {
  margin: 0;
  color: var(--muted);
}

.component-note {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.dashboard-grid,
.conversion-layout,
.handoff-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-bottom: 26px;
}

.handoff-layout,
.conversion-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-panel,
.map-panel,
.side-panel,
.work-panel,
.stack-panel,
.response-panel,
.lead-output,
.lead-context,
.handoff-card-panel,
.sales-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-panel h3,
.map-panel h3 {
  font-size: 1.45rem;
}

.summary-panel p,
.map-panel p {
  color: var(--muted);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.metric {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f4ed;
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  font-size: 1.45rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.map-panel {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
}

.survey-map {
  position: relative;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(53, 82, 90, 0.08) 25%, transparent 25%),
    linear-gradient(225deg, rgba(53, 82, 90, 0.08) 25%, transparent 25%),
    #f6f2e9;
  overflow: hidden;
}

.route-line {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 76px;
  height: 2px;
  transform: rotate(-13deg);
  background: var(--slate);
}

.route-node {
  position: absolute;
  width: 17px;
  height: 17px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--slate);
  z-index: 1;
}

.route-node.one { left: 26px; top: 88px; }
.route-node.two { left: 68px; top: 67px; }
.route-node.three { right: 28px; top: 47px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
}

.section-header h3 {
  font-size: 1.25rem;
}

.card-grid {
  display: grid;
  gap: 14px;
}

.claim-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nugget-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-card,
.feedback-card {
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(33, 36, 31, 0.05);
}

.work-card {
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.work-card:hover {
  border-color: var(--slate);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.work-card h4,
.feedback-card h4 {
  margin-top: 12px;
  font-size: 1.03rem;
  line-height: 1.18;
}

.work-card p,
.feedback-card p,
.helper-text,
.empty-note {
  color: var(--muted);
}

.card-topline,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.card-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.next-action {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--slate) !important;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #f8f5ed;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.badge.green { border-color: rgba(68, 106, 75, 0.35); color: var(--green); background: #edf4ed; }
.badge.blue { border-color: rgba(52, 95, 136, 0.35); color: var(--blue); background: #edf3f7; }
.badge.amber { border-color: rgba(155, 115, 50, 0.38); color: var(--amber); background: #f7f1e5; }
.badge.gray { border-color: rgba(114, 116, 110, 0.36); color: var(--gray); background: #f0efeb; }

.compact-list {
  display: grid;
  gap: 8px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 290px;
  gap: 16px;
  align-items: start;
}

.claim-summary-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f4ed;
}

.claim-summary-panel h3 {
  margin: 0;
  font-size: 1.25rem;
}

.claim-summary-panel p {
  color: var(--muted);
}

.prospect-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.prospect-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.prospect-table th,
.prospect-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prospect-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.prospect-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.prospect-table tbody tr:hover,
.prospect-table tbody tr.active {
  background: #f1f5f6;
}

.prospect-table tbody tr.active {
  box-shadow: inset 3px 0 0 var(--slate);
}

.prospect-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.prospect-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.prospect-card-header h4 {
  margin: 0;
  font-size: 1.35rem;
}

.prospect-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.prospect-facts {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.prospect-facts div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
}

.prospect-facts dt {
  color: var(--muted);
  font-weight: 800;
}

.prospect-facts dd {
  margin: 0;
}

.prospect-nuggets {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f4ed;
}

.prospect-nuggets ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 20px;
}

.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 10px;
}

.claim-selector,
.feedback-list {
  display: grid;
  gap: 10px;
}

.selector-button {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.selector-button strong,
.selector-button span {
  display: block;
}

.selector-button span {
  color: var(--muted);
  font-size: 0.78rem;
}

.selector-button.active {
  border-color: var(--slate);
  box-shadow: inset 3px 0 0 var(--slate);
}

.ghost-button,
.primary-button,
.filter-button {
  padding: 8px 12px;
  font-weight: 800;
}

.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.response-panel blockquote {
  margin: 16px 0;
  padding: 18px;
  border-left: 4px solid var(--green);
  background: #f1f5ee;
  font-size: 1.2rem;
  font-weight: 700;
}

.lead-output {
  opacity: 0.72;
}

.lead-output.is-created {
  opacity: 1;
  outline: 2px solid rgba(68, 106, 75, 0.28);
}

.empty-state {
  display: grid;
  min-height: 210px;
  place-content: center;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.checklist {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.checklist li span {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}

.checklist li.done {
  color: var(--green);
}

.checklist li.done span {
  border-color: var(--green);
  background: var(--green);
}

.cleanup-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.cleanup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 25, 22, 0.36);
  z-index: 20;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 92vw);
  height: 100vh;
  padding: 24px;
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: -24px 0 60px rgba(33, 36, 31, 0.18);
  transform: translateX(105%);
  transition: transform 180ms ease;
  z-index: 21;
  overflow-y: auto;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-close {
  float: right;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.detail-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f4ed;
}

.detail-list div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
}

@media (max-width: 1100px) {
  .claim-grid,
  .cleanup-grid,
  .handoff-layout,
  .conversion-layout,
  .workspace-layout {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-layout .work-panel {
    grid-column: 1 / -1;
    order: 3;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .site-header,
  .page-heading,
  .dashboard-grid,
  .claim-grid,
  .nugget-grid,
  .cleanup-grid,
  .handoff-layout,
  .conversion-layout,
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .site-header,
  .page-heading,
  .site-footer {
    display: block;
  }

  .trail-chip,
  .page-heading p,
  .site-footer span + span {
    margin-top: 14px;
  }

  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline::before {
    display: none;
  }

  .metric-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .map-panel {
    grid-template-columns: 1fr;
  }

  .prospect-facts div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
