:root {
  --ink: #1f2a44;
  --ink-soft: #4a5570;
  --muted: #5f6880;
  --line: #e3dfd7;
  --bg: #faf8f4;
  --card: #ffffff;
  --accent: #b5562f;
  --accent-soft: #f6e9e2;
  --calm: #2f6f6a;
  --calm-soft: #e5f0ee;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 18px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
a { color: var(--calm); }
.small { font-size: .85rem; color: var(--muted); }
.muted { color: var(--muted); }

.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; height: 54px; font-size: .9rem; }
.brand { font-weight: 600; }
.brokerage { color: var(--muted); }
.site-footer { margin-top: 48px; padding: 24px 0 40px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-soft); }

main { padding-top: 22px; padding-bottom: 24px; min-height: 60vh; }

/* Buttons */
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 14px 24px; font: 600 1rem var(--sans); cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2c3a5c; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--calm); font: inherit; text-decoration: underline; cursor: pointer; }

/* Intro */
.intro { padding: 18px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.intro .lede { font-size: 1.08rem; color: var(--ink-soft); }
.checks { list-style: none; padding: 0; margin: 18px 0 26px; }
.checks li { padding-left: 28px; position: relative; margin-bottom: 10px; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--calm); font-weight: 700; }

/* Quiz */
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.progress-bar { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--calm); transition: width .25s ease; }
.progress .count { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.q-help { color: var(--ink-soft); margin-bottom: 18px; }
.options { display: grid; gap: 10px; margin-bottom: 18px; }
.option { display: block; width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 15px 16px; font: 500 1rem var(--sans); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.option:hover { border-color: #c9c2b5; }
.option[aria-pressed="true"] { border-color: var(--calm); background: var(--calm-soft); }
/* Tick-box style for multi-select options */
.option.check { position: relative; padding-left: 46px; }
.option.check::before { content: ""; position: absolute; left: 15px; top: 16px; width: 18px; height: 18px; border: 1.5px solid #b9b2a5; border-radius: 5px; background: #fff; }
.option.check[aria-pressed="true"]::before { background: var(--calm); border-color: var(--calm); }
.option.check[aria-pressed="true"]::after { content: ""; position: absolute; left: 21px; top: 19px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.option .sub { display: block; font-weight: 400; font-size: .88rem; color: var(--muted); margin-top: 2px; }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.note { background: var(--card); border-left: 3px solid var(--line); padding: 10px 14px; font-size: .9rem; color: var(--ink-soft); border-radius: 0 8px 8px 0; margin: 4px 0 18px; }

/* Priority rows */
.prio { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.prio-label { font-weight: 600; margin-bottom: 8px; }
.prio-label .sub { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 4px; font: 500 .85rem var(--sans); color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { border-color: var(--calm); background: var(--calm-soft); color: var(--calm); font-weight: 700; }

/* Results */
.callout { border-radius: var(--radius); padding: 16px 18px; margin: 0 0 20px; }
.callout h3 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.callout-answer { background: var(--calm-soft); }
.callout-answer h3 { color: var(--calm); }
.callout-take { background: var(--accent-soft); }
.callout-take h3 { color: var(--accent); }
.callout p:last-child { margin-bottom: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(31,42,68,.04); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.card-sub { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.match { text-align: right; flex-shrink: 0; }
.match strong { display: block; font-size: 1.5rem; font-family: var(--serif); color: var(--calm); line-height: 1; }
.match span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.serves { display: inline-block; background: var(--calm-soft); color: var(--calm); font-size: .82rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; margin-bottom: 12px; }

.score-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 6px 0 14px; flex-wrap: wrap; }
.score-big { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.score-big small { font-size: .9rem; color: var(--muted); font-family: var(--sans); font-weight: 400; }
.tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 3px 7px; }
.badges { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.badge { font-size: .86rem; color: var(--ink-soft); }
.margin-note { font-size: .78rem; color: var(--muted); width: 100%; }

.section-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ink-soft); margin: 14px 0 6px; }
ul.facts { list-style: none; padding: 0; margin: 0 0 6px; }
ul.facts li { position: relative; padding-left: 22px; margin-bottom: 8px; font-size: .95rem; }
ul.facts.why li::before { content: "+"; position: absolute; left: 2px; color: var(--calm); font-weight: 800; }
ul.facts.trade li::before { content: "–"; position: absolute; left: 3px; color: var(--accent); font-weight: 800; }
ul.facts.also li::before { content: "→"; position: absolute; left: 0; color: var(--calm); }
ul.facts li.flag { background: var(--warn-soft); padding: 8px 10px 8px 30px; border-radius: 8px; }
ul.facts li.flag::before { left: 10px; top: 8px; }
.homefit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 6px; }
.homefit.n2, .homefit.n4 { grid-template-columns: repeat(2, 1fr); }
.homefit div { background: var(--bg); border-radius: 10px; padding: 9px 10px; }
.homefit b { display: block; font-size: .98rem; }
.homefit span { font-size: .74rem; color: var(--muted); }

details { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; color: var(--calm); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: " +"; }
details[open] summary::after { content: " –"; }
.bars { margin-top: 10px; }
.bar { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center; margin-bottom: 8px; font-size: .88rem; }
.bar .track { grid-column: 1 / -1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: -4px; }
.bar .track span { display: block; height: 100%; background: var(--ink-soft); }
.bar .val { text-align: right; font-weight: 600; }

.market { background: var(--bg); border-radius: 10px; padding: 12px; margin-top: 10px; }
.market dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0 0 8px; font-size: .9rem; }
.market dd { margin: 0; font-weight: 600; text-align: right; }
.attribution { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.tour-invite { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-soft); }
.card-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.card-links .btn { padding: 10px 16px; font-size: .9rem; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 20px; }
.toolbar .btn { padding: 10px 16px; font-size: .9rem; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.compare { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .88rem; }
table.compare th, table.compare td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.compare thead th { font-family: var(--serif); font-size: 1rem; }
table.compare tbody th { font-weight: 500; color: var(--ink-soft); width: 34%; }

.cta { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 20px; margin: 26px 0; }
.cta h2 { color: #fff; }
.cta p { color: #d5daea; }
.cta .btn-primary { background: #fff; color: var(--ink); }

form.lead label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
form.lead input, form.lead select, form.lead textarea { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; font: 1rem var(--sans); background: #fff; color: var(--ink); }
form.lead textarea { min-height: 80px; }
form.lead .consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .85rem; color: var(--ink-soft); margin: 16px 0; }
form.lead .consent input { width: auto; margin-top: 3px; }
.form-msg { margin-top: 12px; font-size: .9rem; }
.form-msg.error { color: #a02c2c; }

.disclaimer { font-size: .85rem; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 28px; }
.disclaimer p { margin-bottom: .7em; }

@media (min-width: 640px) {
  h1 { font-size: 2.3rem; }
  .options.two { grid-template-columns: 1fr 1fr; }
  .card { padding: 22px 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
:focus-visible { outline: 3px solid #7fb3ad; outline-offset: 2px; }

/* CREB® district picker: compact two-column chips, even on phones */
.options.districts { grid-template-columns: 1fr 1fr; gap: 8px; }
.options.districts .option { padding-top: 10px; padding-bottom: 10px; text-align: center; }
.options.districts .option.check { text-align: left; padding-left: 40px; }
.options.districts .option.check::before { left: 12px; top: 11px; }
.options.districts .option.check[aria-pressed="true"]::after { left: 18px; top: 14px; }
.preview-banner { background: var(--warn-soft); color: var(--warn); font-size: .82rem; font-weight: 600; text-align: center; padding: 8px 14px; }

/* ---------- Nov 17 quiz-funnel review ---------- */
.byline { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; }
.byline .small { margin: 0; }
.portrait { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.quote { margin: 18px 0 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 var(--radius) var(--radius) 0; }
.quote p { margin: 0 0 4px; font-style: italic; }
.quote cite { font-size: .85rem; color: var(--muted); font-style: normal; }
.strip { list-style: none; counter-reset: s; padding: 0; margin: 4px 0 10px; display: grid; gap: 8px; }
.strip li a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); text-decoration: none; }
.strip li a b { font-family: var(--serif); font-size: 1.12rem; display: block; }
.strip li a span { font-size: .86rem; color: var(--muted); }
.match strong { font-size: 1.05rem; font-family: var(--sans); }
.score-label { font-size: .82rem; color: var(--muted); flex: 1; }
.lead-email h3 { margin-bottom: 4px; }
.lead-email input[type=email] { margin-bottom: 10px; }
.notice { margin: 10px 0 0; font-size: .78rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.chips { border: 0; padding: 0; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
form.lead .chips label { margin: 0; font-weight: 400; }
form.lead .chips input { position: absolute; opacity: 0; width: 1px; }
.chips span { display: block; text-align: center; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 6px; background: #fff; font-size: .9rem; cursor: pointer; }
.chips input:checked + span { border-color: var(--calm); background: var(--calm-soft); color: var(--calm); font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--calm); outline-offset: 2px; }
.cta-mid { margin: 0 0 18px; }
.cta-mid p { margin-bottom: 10px; }
.actionbar { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 75%, rgba(250,248,244,0)); z-index: 5; }
.actionbar .btn { flex: 1; padding: 11px 6px; font-size: .88rem; white-space: nowrap; background: #fff; }
.card { scroll-margin-top: 12px; }

/* Your answers (above the results) */
.answers { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 18px; }
.answers-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.answers-head span { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.answers dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .9rem; }
.answers dt { color: var(--muted); }
.answers dd { margin: 0; }
.audit table { font-size: .78rem; }
.audit tr.pick td { background: var(--calm-soft); }
.audit td.low { color: #a3352b; font-weight: 700; }

/* Grouped workplace list: clear district headings, compact options */
.group { margin: 0 0 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.group:first-of-type { border-top: 0; padding-top: 0; }
.group-label { font-family: var(--serif); font-size: 1.08rem; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.options.compact { gap: 6px; }
.options.compact .option { padding: 10px 14px; font-size: .95rem; }

/* Location or the home */
.strip .role { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--calm); margin-bottom: 2px; }
.serves.role { background: var(--calm-soft); color: var(--calm); font-weight: 700; }
.tradeoff-box h3 { margin-top: 0; }
.group-label.area { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 10px; background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; color: var(--ink); }
.group-label.area span { font-family: var(--sans); font-size: .82rem; font-weight: 600; color: var(--calm); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.group-label.area:hover span, .group-label.area:focus-visible span { color: var(--ink); }
.group-label.area[aria-pressed="true"] span { color: var(--ink); text-decoration: none; }
.group-label.area[aria-pressed="true"] span::before { content: "✓ "; }
.count-note { display: block; margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--calm); }
.count-note.low { color: #9a5a12; }
.count-note.plain { color: var(--muted); }

/* Results map */
.map { margin: 4px 0 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.map svg { width: 100%; height: auto; display: block; max-height: 520px; }
.map-areas path { stroke: #fff; stroke-width: .9; }
.map-district { font: 700 11px var(--sans); fill: #3d4252; text-anchor: middle; letter-spacing: .06em; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.map-pin { fill: var(--calm); stroke: #fff; stroke-width: 2.5; }
.map-pin-n { font: 700 11px var(--sans); fill: #fff; text-anchor: middle; pointer-events: none; }
.map-star { font-size: 20px; fill: #b4581a; text-anchor: middle; stroke: #fff; stroke-width: 1; paint-order: stroke; }
.map figcaption { padding: 6px 4px 2px; }
.map-legend { list-style: none; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; }
.map-legend b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--calm); color: #fff; font-size: .75rem; margin-right: 2px; }
.map-legend .star { color: #b4581a; }
.map-areas path.edge { opacity: .55; }

/* Phase A (expert panel) */
.quiz-nav.sticky { position: sticky; bottom: 0; background: var(--bg, #fff); padding: 10px 0; border-top: 1px solid var(--line); z-index: 5; }
.strip li { list-style: none; }
.strip .meta { display: block; }
.strip .line { display: block; color: var(--ink-soft, var(--ink)); margin-top: 3px; }
.strip .line.trade { color: #8a5a00; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 6px 0 0; }
.tags li { font-size: .78rem; padding: 3px 8px; border-radius: 999px; background: #eef1f6; color: var(--ink); }
.tags li.tag-warn { background: #fff4dc; color: #6b4700; }
.tags li.tag-coi { background: #e8eefc; color: #1f2a44; font-weight: 600; }
.coi { font-size: .85rem; background: #e8eefc; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.also-close { margin: 0 0 14px; }
.answers summary { cursor: pointer; font-size: .92rem; }
.answers details[open] summary { margin-bottom: 8px; }
.how-to-read { margin: 6px 0 16px; }
details.more summary { cursor: pointer; font-size: .88rem; color: var(--calm); margin: 2px 0 8px; }
.swatch-hatch { display: inline-block; width: 14px; height: 10px; vertical-align: middle; background: repeating-linear-gradient(45deg, #5f6880 0 1.2px, #f2f2f2 1.2px 5px); border: 1px solid #c8ccd6; }
.map path.hatch { pointer-events: none; }
.map-star { stroke: #1f2a44; stroke-width: 1.2px; paint-order: stroke; }
.map a:focus-visible circle { stroke: #1f2a44; stroke-width: 4; }
.swipe-hint { margin: 0 0 6px; }
@media (min-width: 640px) { .swipe-hint { display: none; } }
table.compare th:first-child, table.compare td:first-child { position: sticky; left: 0; background: var(--card, #fff); z-index: 1; }
.field-err { color: #a32020; font-size: .85rem; margin: 4px 0 8px; }
[aria-invalid="true"] { border-color: #a32020 !important; }
.tour-invite .linkbtn, .visit-chip .linkbtn { min-height: 24px; min-width: 24px; padding: 4px 2px; }
.visit-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef1f6; border-radius: 999px; padding: 4px 10px; margin: 6px 0 10px; font-size: .9rem; }
.visit-chip[hidden] { display: none; }
.helper { margin-top: -4px; }
@media (max-width: 639px) { table.compare tbody th { width: 118px; min-width: 118px; max-width: 118px; font-size: .82rem; } table.compare td, table.compare thead th { min-width: 120px; } }
