/* =========================================================
   CGY Homes — Market Snapshot funnel
   /market-report/  (landing)  and  /market-map/  (snapshot)

   PALETTE
   Sampled from the CGY Homes Calgary Market Snapshot infographic so
   the funnel and the printed/social piece read as one system:

     #007EC0  map blue      surfaces and fills
     #01639A  blue (text)   derived: the map blue is 4.43:1 on white,
                            just under the 4.5:1 minimum, so it cannot
                            carry text or sit behind white button labels
     #013F6E  navy          headings, dark sections
     #01294A  navy deep     deepest ground
     #64C2B7  teal          district card headers, accents on navy
     #1D7D72  teal (text)   derived, for teal-coloured text on white
     #C32F2C  red           year-over-year decline
     #13795C  green         year-over-year gain
     #ECF5FB  tint          pale blue page ground

   Every pair in use was checked against WCAG AA.

   All selectors are namespaced mkt- so nothing collides with the site
   (.nav, .btn, .footer), the dashboard (.mk-) or the search (.cgy-).
   ========================================================= */

.mkt-scope {
    --m-blue:      #007EC0;
    --m-blue-text: #01639A;
    --m-navy:      #013F6E;
    --m-navy-deep: #01294A;
    --m-teal:      #64C2B7;
    --m-teal-text: #1D7D72;
    --m-red:       #C32F2C;
    --m-green:     #13795C;
    --m-tint:      #ECF5FB;
    --m-line:      #D4E4F0;
    --m-ink:       #12232E;
    --m-muted:     #5A6B78;
    --m-white:     #FFFFFF;
    --m-radius:    10px;
    --m-shadow:    0 1px 2px rgba(1,41,74,.06), 0 8px 24px rgba(1,41,74,.08);
    --m-shadow-lg: 0 24px 60px rgba(1,41,74,.22);
}

.mkt-wrap {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.mkt-eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--m-blue-text);
    margin-bottom: 1rem;
}

.mkt-source-line {
    font-size: 0.78rem;
    color: var(--m-muted);
    line-height: 1.6;
}
.mkt-source-line a { color: var(--m-blue-text); text-decoration: underline; text-underline-offset: 2px; }

/* A note that a figure is summed rather than published verbatim. */
.mkt-derived-note {
    font-size: 0.73rem;
    color: var(--m-muted);
    line-height: 1.6;
    border-left: 2px solid var(--m-line);
    padding-left: 0.75rem;
    margin-top: 1.25rem;
}

/* =========================================================
   LANDING — /market-report/
   ========================================================= */

.mkt-hero {
    background: var(--m-navy-deep);
    color: var(--m-white);
    padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 8vw, 6rem);
    position: relative;
    overflow: hidden;
}

/* Soft wash so the dark block is not a flat slab behind the form. */
.mkt-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(42rem 28rem at 78% -10%, rgba(120, 192, 221, 0.20), transparent 62%),
        radial-gradient(34rem 24rem at 4% 108%, rgba(120, 192, 221, 0.10), transparent 60%);
    pointer-events: none;
}
.mkt-hero > * { position: relative; }

.mkt-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 5vw, 4rem);
    align-items: start;
}

@media (min-width: 900px) {
    .mkt-hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 4rem; }
}

.mkt-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.95rem, 5.2vw, 3.1rem);
    line-height: 1.12;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.mkt-hero-sub {
    font-size: clamp(1rem, 2.1vw, 1.12rem);
    line-height: 1.65;
    color: var(--m-line);
    max-width: 54ch;
    margin-bottom: 2rem;
}

.mkt-valueprops {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
}
@media (min-width: 560px) { .mkt-valueprops { grid-template-columns: 1fr 1fr; } }

.mkt-valueprops li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--m-line);
}

.mkt-valueprops svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 0.22rem;
    color: var(--m-blue-text);
}

/* ---------- map preview (locked) ---------- */

.mkt-preview {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 1.25rem;
    overflow: hidden;
}

.mkt-preview svg { width: 100%; height: auto; display: block; }

.mkt-preview-shape {
    fill: var(--m-blue);
    fill-opacity: calc(var(--w, 0.3) * 0.75);
    stroke: rgba(255, 255, 255, 0.28);
    stroke-width: 1.5;
}

.mkt-preview-veil {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(30, 30, 30, 0.94) 14%, rgba(30, 30, 30, 0.35) 62%, transparent);
    text-align: center;
}

.mkt-preview-veil p {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--m-line);
    margin: 0;
}

/* =========================================================
   LEAD FORM
   ========================================================= */

.mkt-form-card {
    background: var(--m-white);
    color: var(--m-navy-deep);
    border-radius: 4px;
    padding: clamp(1.5rem, 3.5vw, 2.25rem);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.mkt-form-card h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.mkt-form-lede {
    font-size: 0.88rem;
    color: var(--m-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.mkt-field { margin-bottom: 1rem; }

.mkt-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--m-muted);
    margin-bottom: 0.4rem;
}

.mkt-field .mkt-req { color: var(--m-blue-text); }

.mkt-field input,
.mkt-field select {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;              /* 16px minimum — stops iOS zooming on focus */
    font-weight: 300;
    color: var(--m-navy-deep);
    background: var(--m-tint);
    border: 1px solid var(--m-line);
    border-radius: 3px;
    padding: 0.85rem 0.9rem;      /* ~48px tall tap target */
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.mkt-field input:focus,
.mkt-field select:focus {
    outline: none;
    border-color: var(--m-blue-text);
    box-shadow: 0 0 0 3px rgba(0,126,192,.18);
}

.mkt-field input[aria-invalid="true"] { border-color: #B23B3B; }

.mkt-field-error {
    display: none;
    font-size: 0.78rem;
    color: #B23B3B;
    margin-top: 0.35rem;
}
.mkt-field input[aria-invalid="true"] ~ .mkt-field-error { display: block; }

@media (min-width: 520px) {
    .mkt-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    .mkt-field-row .mkt-field { margin-bottom: 1rem; }
}

/* Honeypot: off-screen, not display:none, so bots that check
   visibility still fill it in. Never shown to a real visitor. */
.mkt-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

.mkt-consent {
    font-size: 0.76rem;
    line-height: 1.6;
    color: var(--m-muted);
    margin: 1.1rem 0 1.4rem;
}

.mkt-consent label {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin-bottom: 0.7rem;
    cursor: pointer;
}

.mkt-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px; height: 18px;
    margin-top: 0.1rem;
    accent-color: var(--m-blue-text);
}

.mkt-consent a { color: var(--m-blue-text); text-decoration: underline; text-underline-offset: 2px; }

.mkt-submit {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--m-white);
    background: var(--m-blue-text);
    border: none;
    border-radius: 3px;
    padding: 1.1rem 1.5rem;
    cursor: pointer;
    transition: background 0.3s var(--ease), transform 0.2s var(--ease);
}
.mkt-submit:hover:not(:disabled) { background: var(--m-navy); }
.mkt-submit:active:not(:disabled) { transform: translateY(1px); }
.mkt-submit:disabled { opacity: 0.6; cursor: progress; }

.mkt-form-foot {
    font-size: 0.72rem;
    color: var(--m-muted);
    text-align: center;
    margin-top: 1rem;
    line-height: 1.6;
}

.mkt-form-status {
    display: none;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.85rem 1rem;
    border-radius: 3px;
    margin-bottom: 1rem;
}
.mkt-form-status.is-error {
    display: block;
    background: #FBEDED;
    border-left: 3px solid #B23B3B;
    color: #7A2626;
}

/* =========================================================
   SNAPSHOT — /market-map/
   ========================================================= */

.mkt-snap-head {
    background: var(--m-navy-deep);
    color: var(--m-white);
    padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(2.25rem, 5vw, 3rem);
}

.mkt-snap-head h1 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4.2vw, 2.5rem);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.mkt-snap-sub {
    color: var(--m-line);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 60ch;
}

.mkt-citybar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.14);
    margin-top: 2rem;
}
@media (min-width: 760px) { .mkt-citybar { grid-template-columns: repeat(5, 1fr); } }

.mkt-citybar div {
    background: var(--m-navy-deep);
    padding: 0.9rem 1rem;
}
.mkt-citybar dt {
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--m-line);
    margin-bottom: 0.3rem;
}
.mkt-citybar dd {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--m-white);
}

/* ---------- layout ---------- */

.mkt-snap-body { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; background: var(--m-tint); }

.mkt-split { display: grid; grid-template-columns: 1fr; gap: 2rem; }

@media (min-width: 960px) {
    .mkt-split { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 2.5rem; align-items: start; }
    .mkt-map-col { position: sticky; top: 90px; }
}

/* ---------- the map ---------- */

.mkt-map-frame {
    background: var(--m-white);
    border: 1px solid var(--m-line);
    border-radius: 4px;
    padding: 1.25rem;
}

.mkt-map-frame svg { width: 100%; height: auto; display: block; }

.mkt-map-district { cursor: pointer; outline: none; }

.mkt-map-shape {
    fill: var(--m-blue);
    fill-opacity: var(--w, 0.3);
    stroke: var(--m-white);
    stroke-width: 2;
    transition: fill-opacity 0.22s var(--ease), stroke 0.22s var(--ease);
}

.mkt-map-district:hover .mkt-map-shape { fill-opacity: calc(var(--w, 0.3) + 0.18); }

.mkt-map-district.mkt-is-selected .mkt-map-shape {
    fill-opacity: calc(var(--w, 0.3) + 0.26);
    stroke: var(--m-navy-deep);
    stroke-width: 3;
}

.mkt-map-district:focus-visible .mkt-map-shape {
    stroke: var(--m-navy-deep);
    stroke-width: 3;
    stroke-dasharray: 6 4;
}

.mkt-map-label {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    fill: var(--m-navy-deep);
    pointer-events: none;
}

.mkt-map-price {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    fill: var(--m-navy-deep);
    opacity: 0.72;
    pointer-events: none;
}

/* Abbreviations below 560px, full names above. */
.mkt-map-label-short { display: none; }
@media (max-width: 560px) {
    .mkt-map-label-full { display: none; }
    .mkt-map-label-short { display: inline; }
    .mkt-map-label { font-size: 20px; }
    .mkt-map-price { font-size: 16px; }
}

.mkt-map-legend {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    font-size: 0.72rem;
    color: var(--m-muted);
}
.mkt-map-legend-ramp {
    flex: 1;
    height: 7px;
    border-radius: 4px;
    background: linear-gradient(to right,
        rgba(120, 192, 221, 0.18), rgba(120, 192, 221, 0.85));
}

.mkt-map-caption {
    font-size: 0.72rem;
    color: var(--m-muted);
    line-height: 1.6;
    margin-top: 0.9rem;
}

/* District list — the keyboard and small-screen route to every
   district without hunting for a polygon. */
.mkt-chiprow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}

.mkt-chip {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: var(--m-muted);
    background: var(--m-white);
    border: 1px solid var(--m-line);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.mkt-chip:hover { border-color: var(--m-blue-text); color: var(--m-blue-text); }
.mkt-chip.mkt-is-active {
    background: var(--m-blue-text);
    border-color: var(--m-blue-text);
    color: var(--m-white);
}

/* ---------- report panel ---------- */

.mkt-panel {
    background: var(--m-white);
    border: 1px solid var(--m-line);
    border-radius: 4px;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.mkt-panel-head { border-bottom: 1px solid var(--m-line); padding-bottom: 1.25rem; margin-bottom: 1.5rem; }

.mkt-panel-head h2 {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3.4vw, 1.9rem);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 0.3rem;
}

.mkt-panel-month {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--m-muted);
}

.mkt-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.mkt-headline-value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 2.9rem);
    font-weight: 500;
    line-height: 1;
    color: var(--m-navy-deep);
}

.mkt-headline-label {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--m-muted);
    margin-bottom: 0.9rem;
}

.mkt-delta {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
    white-space: nowrap;
}
/* Direction is carried by an arrow glyph and the text, never colour alone. */
.mkt-delta.is-up   { background: rgba(47, 107, 79, 0.12); color: #2F6B4F; }
.mkt-delta.is-down { background: rgba(20, 104, 138, 0.12); color: var(--m-blue-text); }
.mkt-delta.is-flat { background: rgba(94, 100, 104, 0.12); color: var(--m-muted); }

/* ---------- property-type tabs ---------- */

.mkt-types {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--m-line);
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}
.mkt-types::-webkit-scrollbar { display: none; }

.mkt-type-btn {
    flex: 0 0 auto;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--m-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.mkt-type-btn:hover { color: var(--m-blue-text); }
.mkt-type-btn[aria-selected="true"] {
    color: var(--m-blue-text);
    border-bottom-color: var(--m-blue-text);
    font-weight: 500;
}

/* ---------- stat grid ---------- */

.mkt-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 600px) { .mkt-stats { grid-template-columns: repeat(3, 1fr); } }

.mkt-stat {
    background: var(--m-tint);
    border: 1px solid var(--m-line);
    border-radius: 3px;
    padding: 0.9rem 1rem;
}

.mkt-stat-label {
    display: block;
    font-size: 0.63rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--m-muted);
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.mkt-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--m-navy-deep);
    line-height: 1.1;
}

.mkt-stat-sub { display: block; font-size: 0.72rem; color: var(--m-muted); margin-top: 0.25rem; }

/* ---------- comparison bars ---------- */

.mkt-compare { margin-bottom: 1.75rem; }

.mkt-compare h3,
.mkt-panel h3 {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--m-muted);
    margin-bottom: 0.9rem;
}

.mkt-bar-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.35rem 0;
    font-size: 0.8rem;
}

.mkt-bar-name { color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mkt-bar-track { background: var(--m-tint); border-radius: 2px; height: 10px; overflow: hidden; }

.mkt-bar-fill {
    height: 100%;
    background: var(--m-blue);
    border-radius: 2px;
    transition: width 0.5s var(--ease-out);
}
.mkt-bar-row.mkt-is-current .mkt-bar-fill { background: var(--m-blue-text); }
.mkt-bar-row.mkt-is-current .mkt-bar-name { color: var(--m-navy-deep); font-weight: 500; }

.mkt-bar-value { font-variant-numeric: tabular-nums; color: var(--m-navy-deep); white-space: nowrap; }

/* ---------- CTAs ---------- */

.mkt-cta-block {
    background: var(--m-navy-deep);
    color: var(--m-white);
    border-radius: 4px;
    padding: clamp(1.5rem, 3.5vw, 2.25rem);
    margin-top: 2rem;
}

.mkt-cta-block h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--m-white);
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 0.6rem;
}

.mkt-cta-block p { font-size: 0.88rem; line-height: 1.6; color: var(--m-line); margin-bottom: 1.4rem; }

.mkt-cta-actions { display: grid; grid-template-columns: 1fr; gap: 0.7rem; }
@media (min-width: 560px) { .mkt-cta-actions { grid-template-columns: 1fr 1fr; } }

.mkt-cta-btn {
    display: block;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.95rem 1.1rem;
    border-radius: 3px;
    transition: all 0.25s var(--ease);
}
.mkt-cta-btn.is-primary { background: var(--m-blue-text); color: var(--m-white); }
.mkt-cta-btn.is-primary:hover { background: var(--m-blue); color: var(--m-navy-deep); }
.mkt-cta-btn.is-ghost { border: 1px solid rgba(255, 255, 255, 0.3); color: var(--m-white); }
.mkt-cta-btn.is-ghost:hover { border-color: var(--m-blue); color: var(--m-blue); }

/* ---------- mobile sheet ---------- */

@media (max-width: 959px) {
    .mkt-panel.mkt-sheet {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 120;
        max-height: 82vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;      /* scroll stays in the sheet */
        border-radius: 14px 14px 0 0;
        border: none;
        box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.26);
        transform: translateY(100%);
        transition: transform 0.32s var(--ease-out);
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    }
    .mkt-panel.mkt-sheet.mkt-is-open { transform: translateY(0); }

    .mkt-sheet-grip {
        display: block;
        width: 38px; height: 4px;
        border-radius: 2px;
        background: var(--m-line);
        margin: 0 auto 1rem;
    }

    .mkt-sheet-close {
        position: absolute;
        top: 0.9rem; right: 0.9rem;
        width: 40px; height: 40px;
        border: none; background: none;
        color: var(--m-muted);
        font-size: 1.4rem;
        line-height: 1;
        cursor: pointer;
    }

    .mkt-scrim {
        position: fixed;
        inset: 0;
        z-index: 119;
        background: rgba(20, 20, 20, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s var(--ease);
    }
    .mkt-scrim.mkt-is-open { opacity: 1; pointer-events: auto; }
}

@media (min-width: 960px) {
    .mkt-sheet-grip, .mkt-sheet-close, .mkt-scrim { display: none; }
}

/* ---------- gate notice ---------- */

.mkt-locked {
    min-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.25rem;
}
.mkt-locked p { color: var(--m-muted); font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
    .mkt-bar-fill, .mkt-panel.mkt-sheet, .mkt-scrim, .mkt-map-shape { transition: none; }
}


/* =========================================================
   SHARPENING PASS
   Softer radii, real shadows, and a map that behaves like a
   control surface rather than a picture.
   ========================================================= */

.mkt-scope { color: var(--m-ink); }

.mkt-form-card,
.mkt-panel,
.mkt-map-frame,
.mkt-stat,
.mkt-preview { border-radius: var(--m-radius); }

.mkt-form-card { box-shadow: var(--m-shadow-lg); border: 1px solid rgba(255,255,255,.14); }
.mkt-map-frame,
.mkt-panel     { box-shadow: var(--m-shadow); border-color: var(--m-line); }

.mkt-hero { background: linear-gradient(165deg, var(--m-navy) 0%, var(--m-navy-deep) 72%); }
.mkt-hero::before {
    background:
        radial-gradient(40rem 26rem at 82% -12%, rgba(100,194,183,.20), transparent 62%),
        radial-gradient(34rem 24rem at 2% 108%, rgba(0,126,192,.26), transparent 60%);
}

.mkt-eyebrow { color: var(--m-teal); letter-spacing: .2em; }
.mkt-hero-sub { color: #C7DCEC; }
.mkt-valueprops li { color: #D6E7F3; }
.mkt-valueprops svg { color: var(--m-teal); }

/* ---- map ---- */
.mkt-map-frame { background: var(--m-white); padding: 1rem; }

.mkt-map-shape {
    fill: var(--m-blue);
    fill-opacity: var(--w, .5);
    stroke: #FFFFFF;
    stroke-width: 2.5;
    stroke-linejoin: round;
    transition: fill-opacity .2s var(--ease), stroke .2s var(--ease);
}
.mkt-map-district:hover .mkt-map-shape { fill-opacity: calc(var(--w, .5) + .16); }
.mkt-map-district.mkt-is-selected .mkt-map-shape {
    fill-opacity: calc(var(--w, .5) + .24);
    stroke: var(--m-navy-deep);
    stroke-width: 3.5;
}
.mkt-map-district:focus-visible .mkt-map-shape {
    stroke: var(--m-navy-deep); stroke-width: 3.5; stroke-dasharray: 7 5;
}

/* Labels sit on a saturated fill, so they are white with a soft dark
   halo — readable over both the palest and the deepest districts. */
.mkt-map-label, .mkt-map-price {
    fill: #FFFFFF;
    paint-order: stroke fill;
    stroke: rgba(1,41,74,.42);
    stroke-width: 3px;
    stroke-linejoin: round;
}
.mkt-map-label { font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.mkt-map-price { font-weight: 600; font-size: 13.5px; opacity: .97; }

@media (max-width: 560px) {
    .mkt-map-label { font-size: 21px; }
    .mkt-map-price { font-size: 18px; }
}

.mkt-map-legend-ramp {
    background: linear-gradient(to right, rgba(0,126,192,.20), rgba(0,126,192,.92));
    height: 8px;
}

/* ---- district chips ---- */
.mkt-chip {
    border-radius: 999px;
    border-color: var(--m-line);
    color: var(--m-navy);
    font-weight: 500;
}
.mkt-chip:hover { border-color: var(--m-blue); color: var(--m-blue-text); background: var(--m-tint); }
.mkt-chip.mkt-is-active {
    background: var(--m-navy); border-color: var(--m-navy); color: #fff;
}

/* ---- panel ---- */
.mkt-panel-head { border-bottom: 2px solid var(--m-tint); }
.mkt-panel-head h2 { color: var(--m-navy); }
.mkt-headline-value { color: var(--m-navy); letter-spacing: -.01em; }

.mkt-delta { border-radius: 999px; font-weight: 600; padding: .3rem .7rem; }
.mkt-delta.is-up   { background: rgba(19,121,92,.12);  color: var(--m-green); }
.mkt-delta.is-down { background: rgba(195,47,44,.10);  color: var(--m-red); }
.mkt-delta.is-flat { background: rgba(90,107,120,.12); color: var(--m-muted); }

/* ---- property type tabs ---- */
.mkt-types { border-bottom: 2px solid var(--m-tint); gap: .15rem; }
.mkt-type-btn { border-radius: 6px 6px 0 0; }
.mkt-type-btn:hover { color: var(--m-blue-text); background: var(--m-tint); }
.mkt-type-btn[aria-selected="true"] {
    color: var(--m-navy); border-bottom-color: var(--m-blue); background: var(--m-tint);
}

/* ---- stats ---- */
.mkt-stat { background: var(--m-tint); border-color: transparent; }
.mkt-stat-value { color: var(--m-navy); }
.mkt-citybar div { background: transparent; }
.mkt-citybar { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.16); }
.mkt-citybar dt { color: var(--m-teal); }

/* ---- comparison bars ---- */
.mkt-bar-track { background: var(--m-tint); height: 11px; border-radius: 6px; }
.mkt-bar-fill  { background: var(--m-blue); opacity: .55; border-radius: 6px; }
.mkt-bar-row.mkt-is-current .mkt-bar-fill { background: var(--m-navy); opacity: 1; }

/* ---- CTA ---- */
.mkt-cta-block { background: linear-gradient(160deg, var(--m-navy) 0%, var(--m-navy-deep) 100%); }
.mkt-cta-btn.is-primary { background: var(--m-teal); color: var(--m-navy-deep); font-weight: 600; }
.mkt-cta-btn.is-primary:hover { background: #7FD2C8; }
.mkt-cta-btn.is-ghost:hover { border-color: var(--m-teal); color: var(--m-teal); }

/* ---- form ---- */
.mkt-field input, .mkt-field select { border-radius: 8px; border-color: #C3D6E4; background: #FBFDFE; }
.mkt-field input:focus, .mkt-field select:focus {
    border-color: var(--m-blue); box-shadow: 0 0 0 3px rgba(0,126,192,.18); background: #fff;
}
.mkt-submit {
    background: var(--m-blue-text); border-radius: 8px; font-weight: 600; letter-spacing: .1em;
}
.mkt-submit:hover:not(:disabled) { background: var(--m-navy); }
.mkt-form-card h2 { color: var(--m-navy); }

/* ---- city-wide strip on the landing page ----
   These figures are already public on /calgary-housing-market/ and are
   printed on the flyer itself, so showing them before the form costs
   nothing and proves the page is a real market report. */
.mkt-citystats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    margin: 0 0 2rem;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: var(--m-radius);
    overflow: hidden;
}
@media (min-width: 620px) { .mkt-citystats { grid-template-columns: repeat(5, 1fr); } }
.mkt-citystats div { background: rgba(1,41,74,.55); padding: .8rem .9rem; }
.mkt-citystats dt {
    font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--m-teal); margin-bottom: .3rem; line-height: 1.4;
}
.mkt-citystats dd {
    margin: 0; font-family: var(--font-display); font-size: 1.1rem; color: #fff;
}

/* ---- locked preview ---- */
.mkt-preview { background: rgba(255,255,255,.05); padding: 1rem; }
.mkt-preview-shape {
    fill: var(--m-teal);
    fill-opacity: calc(var(--w, .4) * .85);
    stroke: rgba(255,255,255,.55);
    stroke-width: 2.5;
    stroke-linejoin: round;
}
.mkt-preview-label {
    font-family: var(--font-body); font-size: 15px; font-weight: 600;
    fill: #fff; paint-order: stroke fill;
    stroke: rgba(1,41,74,.5); stroke-width: 3px; stroke-linejoin: round;
}

/* ---- landing fixes ----
   The preview is a teaser, not the main event: capping its height keeps
   the hero from running to 1400px and leaving the form stranded beside
   a column of empty navy. */
.mkt-preview svg { max-height: 430px; width: 100%; height: auto; }
@media (max-width: 899px) { .mkt-preview svg { max-height: 360px; } }

/* The old veil was a near-opaque gradient that swallowed South and
   South East. District names carry the "there is more here" message;
   the veil only needs to label the state. */
.mkt-preview-veil {
    background: linear-gradient(to top, rgba(1,41,74,.72) 0%, rgba(1,41,74,.18) 34%, transparent 62%);
    padding: 1.1rem;
}
.mkt-preview-veil p {
    color: #DCEBF5; font-size: .74rem; letter-spacing: .14em; font-weight: 500;
}

/* Crisper preview: lighter fills and a brighter edge read sharp on navy
   instead of murky. */
.mkt-preview-shape {
    fill: #9FD9F0;
    fill-opacity: calc(.26 + var(--w, .4) * .54);
    stroke: rgba(255,255,255,.72);
    stroke-width: 2;
}
.mkt-preview-label { font-size: 14px; stroke: rgba(1,41,74,.62); fill: #FFFFFF; }

.mkt-citystats dt { letter-spacing: .09em; font-size: .58rem; }
.mkt-citystats div { padding: .75rem .8rem; }

/* "already registered" notice — a class, never an inline display that
   would defeat the hidden attribute. */
.mkt-already {
    background: var(--m-tint);
    border-left: 3px solid var(--m-blue);
    color: var(--m-navy);
    font-size: .85rem; line-height: 1.6;
    padding: .85rem 1rem; border-radius: 0 6px 6px 0; margin-bottom: 1rem;
}
.mkt-already a { color: var(--m-blue-text); font-weight: 600; }
.mkt-already[hidden] { display: none; }

/* ---- balance the hero columns ----
   Calgary is far taller than it is wide, so a tall map in a wide column
   letterboxes. Give it more height, and put real content under the form
   instead of leaving a column of empty navy. */
.mkt-preview { padding: .6rem; }
.mkt-preview svg { max-height: 500px; }
@media (max-width: 899px) { .mkt-preview svg { max-height: 380px; } }
.mkt-preview-label { font-size: 17px; stroke-width: 3.5px; }

.mkt-assure {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: .75rem;
}
.mkt-assure li {
    position: relative;
    padding-left: 1.4rem;
    font-size: .82rem;
    line-height: 1.6;
    color: #C7DCEC;
}
.mkt-assure li::before {
    content: '';
    position: absolute;
    left: 0; top: .52em;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--m-teal);
}
.mkt-assure strong { color: #fff; font-weight: 600; }

.mkt-hero { padding-bottom: clamp(2.5rem, 5vw, 4rem); }

/* Room for the caption bar so it never sits on top of a district. */
.mkt-preview { padding-bottom: 2.6rem; }

/* ---- snapshot fixes ----
   A `display` rule in a class beats the [hidden] attribute, so these
   two need an explicit override or they stay on screen forever.
   The loading block did exactly that: it kept rendering above the
   content after the data arrived. */
.mkt-locked[hidden] { display: none; }
.mkt-panel[hidden]  { display: none; }

/* The derived-data note sat flush against the comparison heading. */
.mkt-derived-note { margin: 0 0 1.75rem; }
.mkt-compare { margin-top: .25rem; }

.mkt-greeting {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.6vw, 1.5rem);
    color: var(--m-teal);
    margin-bottom: .4rem;
    font-weight: 400;
}
.mkt-greeting[hidden] { display: none; }

/* The site nav is fixed, so this header needs enough top padding to
   clear it — the greeting was sliding underneath the bar. */
.mkt-snap-head { padding-top: clamp(6.5rem, 9vw, 8.5rem); }

/* Wrapper so the form card and its assurances count as ONE grid child —
   a third child would wrap onto a new row in the left column. */
.mkt-form-col { display: block; }
