:root {
  --bg: #edf3fb;
  --card: #ffffff;
  --border: #d8e3f3;
  --ink: #15304f;
  --muted: #5c738d;
  --blue-1: #0d4f97;
  --blue-2: #1c69c4;
  --blue-3: #dbe9ff;
  --blue-4: #eef5ff;
  --gold: #f6c24c;
  --green: #0d8b6f;
  --red: #cc4f5f;
  --purple: #8b74ff;
  --shadow: 0 10px 28px rgba(13, 79, 151, 0.08);
  --radius: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(180deg, #f5f8fd 0%, #edf3fb 100%);
  color: var(--ink);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.page-shell {
  width: min(1320px, calc(100vw - 24px));
  margin: 22px auto 40px;
}
.hero {
  background: linear-gradient(135deg, #0c4f96 0%, #2d72bd 100%);
  border-radius: 34px;
  padding: 34px 36px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  color: white;
  box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-flex;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.hero h1 {
  font-size: clamp(42px, 6vw, 66px);
  line-height: 0.95;
  margin: 18px 0 14px;
  font-weight: 800;
}
.hero-subtitle {
  font-size: 20px;
  line-height: 1.55;
  max-width: 760px;
  margin: 0;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.hero-pills span {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 14px;
  font-weight: 600;
}
.hero-panel {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 28px;
  padding: 22px 24px;
}
.hero-panel h2 {
  font-size: 22px;
  margin: 0 0 16px;
  font-weight: 800;
}
.hero-panel ul {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
  font-size: 17px;
  line-height: 1.45;
}

.wizard {
  display: flex;
  gap: 12px;
  margin: 20px 0 16px;
}
.wizard-step {
  flex: 1;
  border: 1px solid var(--border);
  background: #f4f8ff;
  color: var(--muted);
  padding: 16px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-align: left;
}
.wizard-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border);
  margin-right: 10px;
  font-size: 13px;
}
.wizard-step.is-active {
  background: var(--blue-3);
  color: var(--blue-1);
  border-color: #b5cff6;
}

.step-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.hidden { display: none; }
.step-headline {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.step-headline.compact { grid-template-columns: 1fr; }
.helper-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #eef4fd;
  color: var(--blue-1);
  font-weight: 700;
  border: 1px solid #d7e4f8;
  margin-bottom: 14px;
}
.helper-chip-blue { background: #e6f0ff; }
.helper-chip-gold { background: #fff6d8; color: #8a6400; border-color: #f1e0a5; }
.step-card h2 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.96;
  margin: 0 0 12px;
  font-weight: 800;
}
.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}
.headline-image {
  width: 100%;
  height: auto;
  border-radius: 24px;
  object-fit: cover;
  display: block;
  min-height: 260px;
  max-height: 360px;
  box-shadow: 0 12px 32px rgba(12,79,150,0.14);
}
.result-visual { max-height: 290px; }

.business-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.business-card {
  border: 1px solid var(--border);
  background: #fafcff;
  border-radius: 22px;
  padding: 20px 18px;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.business-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13,79,151,0.08);
  border-color: #b8cff1;
}
.business-card.is-selected {
  border-color: var(--blue-2);
  box-shadow: 0 10px 22px rgba(13,79,151,0.12);
  background: #f2f7ff;
}
.business-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #eaf2ff;
  font-size: 28px;
  margin-bottom: 14px;
}
.business-card h3 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 800;
}
.business-card p {
  font-size: 15px;
  color: var(--muted);
}

.chooser-layout,
.result-layout,
.explain-layout {
  display: grid;
  gap: 20px;
}
.chooser-layout { grid-template-columns: 1.2fr .8fr; }
.result-layout { grid-template-columns: .78fr 1.22fr; margin-top: 8px; }
.explain-layout { grid-template-columns: .8fr 1.2fr; margin-top: 18px; }

.map-card,
.sidebar-card,
.winner-card,
.score-panel,
.next-card,
.chat-card {
  border: 1px solid var(--border);
  background: #fbfdff;
  border-radius: 26px;
  padding: 20px;
}
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.choice-toggle,
.ghost-btn,
.secondary-btn,
.primary-btn {
  border-radius: 18px;
  border: 1px solid transparent;
  padding: 13px 16px;
  font-weight: 700;
  transition: .15s ease;
}
.choice-toggle {
  background: #edf3fb;
  color: var(--ink);
  border-color: #d6e2f2;
}
.choice-toggle.is-active {
  background: var(--blue-2);
  color: #fff;
  border-color: var(--blue-2);
}
.ghost-btn {
  background: #fff2f3;
  color: #a83f49;
  border-color: #f1cfd3;
}
.ghost-btn.large { background: #f8fbff; color: var(--muted); border-color: var(--border); }
.secondary-btn {
  background: #f2f6fc;
  color: var(--ink);
  border-color: var(--border);
}
.primary-btn {
  background: linear-gradient(135deg, #0d4f97 0%, #2d72bd 100%);
  color: white;
  border-color: transparent;
}
.primary-btn.small { padding: 12px 14px; border-radius: 14px; }
.primary-btn:disabled,
.ghost-btn:disabled,
.secondary-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.map-instruction {
  font-size: 16px !important;
  color: var(--blue-1) !important;
  font-weight: 600;
  margin-bottom: 12px !important;
}
.svg-map-wrap {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid #dbe5f2;
  background: #f7fbff;
}
#neighborhood-map { width: 100%; display: block; }
.road { stroke: #d6e4ff; stroke-width: 16; fill: none; stroke-linecap: round; opacity: .85; }
.road.secondary { stroke-width: 12; opacity: .7; }
.route-dashed { stroke: #cadefb; stroke-width: 3; stroke-dasharray: 10 12; fill: none; opacity: .9; }
.route-dashed.faint { opacity: .5; }

.hood path {
  fill: rgba(76, 139, 245, 0.12);
  stroke: rgba(76, 139, 245, 0.74);
  stroke-width: 3;
  transition: .15s ease;
  cursor: pointer;
}
.hood text {
  fill: #173153;
  font-family: Inter, sans-serif;
  font-size: 18px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}
.hood .sub {
  font-size: 13px;
  font-weight: 600;
  fill: #5c738d;
}
.hood .tiny {
  font-size: 12px;
  font-weight: 700;
}
.hood:hover path { fill: rgba(76, 139, 245, 0.2); }
.hood.is-a path {
  fill: rgba(76, 139, 245, 0.34);
  stroke: #1c69c4;
}
.hood.is-b path {
  fill: rgba(139, 116, 255, 0.28);
  stroke: #7d67f0;
}
.hood.is-a.is-b path {
  fill: rgba(246,194,76,0.42);
  stroke: #c69400;
}

.choice-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.option-box {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  min-height: 112px;
}
.option-a { background: #edf5ff; }
.option-b { background: #f3f0ff; }
.option-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}
.option-name { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.option-tag { font-size: 15px; color: var(--muted); }
.sidebar-mini-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  background: white;
}
.sidebar-mini-card h3,
.score-header h3,
.next-card h3,
.chat-card h3,
.winner-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 800;
}
.sidebar-mini-card ul,
.winner-reasons,
.next-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}
.sidebar-mini-card li,
.winner-reasons li,
.next-card li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}
.step-actions.single-right { justify-content: flex-end; }

.winner-card {
  background: linear-gradient(145deg, #0d4f97 0%, #2d72bd 100%);
  color: white;
}
.winner-badge {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 12px;
}
.winner-card h3 { font-size: 34px; }
.winner-card p { color: rgba(255,255,255,0.92); margin-bottom: 16px; }
.winner-reasons { padding-left: 20px; }
.winner-reasons li { color: rgba(255,255,255,0.92); }

.score-panel { background: #ffffff; }
.score-header p { font-size: 15px !important; margin-bottom: 16px !important; }
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.score-metric {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  background: #fbfdff;
}
.metric-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}
.metric-top h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.metric-top span {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}
.metric-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 12px;
}
.score-row {
  display: grid;
  grid-template-columns: 88px 1fr 54px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.score-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.score-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #edf3fb;
  overflow: hidden;
}
.score-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
}
.score-fill.a { background: linear-gradient(90deg, #5fa8ff, #1f79d5); }
.score-fill.b { background: linear-gradient(90deg, #b8a6ff, #8a73ff); }
.score-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  text-align: right;
}

.next-card { background: #fffdf5; }
.next-steps-list { margin: 0; padding-left: 18px; }
.next-steps-list li { margin-bottom: 8px; font-size: 15px; color: var(--muted); }
.chat-help { font-size: 14px !important; margin-bottom: 12px !important; }
.chat-log {
  min-height: 160px;
  max-height: 260px;
  overflow: auto;
  background: #f7faff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}
.chat-bubble {
  max-width: 82%;
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.45;
  margin-bottom: 10px;
}
.chat-bubble.user {
  background: #dfeeff;
  color: var(--blue-1);
  margin-left: auto;
}
.chat-bubble.bot {
  background: white;
  color: var(--ink);
  border: 1px solid var(--border);
}
.chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.quick-question {
  border: 1px solid var(--border);
  background: #f7faff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
#chat-input {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: white;
}

@media (max-width: 1080px) {
  .hero, .step-headline, .chooser-layout, .result-layout, .explain-layout {
    grid-template-columns: 1fr;
  }
  .business-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .score-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .page-shell { width: min(100vw - 12px, 1320px); }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 44px; }
  .step-card { padding: 20px; }
  .wizard { flex-direction: column; }
  .business-grid { grid-template-columns: 1fr; }
  .step-card h2 { font-size: 38px; }
  .option-name { font-size: 22px; }
  .step-actions { flex-direction: column; }
  .chat-compose { grid-template-columns: 1fr; }
}
