/* =============================================================================
   Agent sponsor card, phone bar and bottom sheet
   Markup: template-parts/sponsor-card.php, sponsor-form-fields.php,
   sponsor-bar.php. Behaviour: js/sponsor-card.js.
   Loaded only on the five sponsor page types, and only while the card shows.
   Uses the theme's tokens (style.css :root) with fallbacks.

   Contrast, all checked for WCAG 2.2 AA: white on the site red is 5.3:1;
   #b91c1c on white 6.5:1; --sp-text on the pink card 9.4:1; --sp-body
   (hints) 6.9:1. Field and chip borders are #64748b so they hold 3:1 on the
   pink (the site's #cbd5e1 would vanish).
   ============================================================================= */

.coc-sponsor, .coc-sheet, .coc-heval-panel {
  --sp-red: var(--color-primary, #cf2627);
  --sp-red-hover: var(--color-primary-hover, #b91c1c);
  --sp-pink: var(--color-pink-bg, #fef2f2);
  --sp-ink: var(--color-dark, #1a1a1a);
  --sp-text: #1e293b;
  --sp-body: #475569;
  --sp-rule: #f3c6c6;
  --sp-focus: #1d4ed8;
  font-family: var(--font, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  line-height: 1.4;
  color: var(--sp-ink);
}
.coc-sponsor *, .coc-sponsor *::before, .coc-sponsor *::after,
.coc-sheet *, .coc-sheet *::before, .coc-sheet *::after { box-sizing: border-box; }

/* ---- where the card sits between page sections ---- */
.coc-sponsor-slot { padding: 20px 0; }
.coc-sponsor-slot--inline { padding: 12px 0 20px; }

/* /neighbourhoods/: the sponsor line sits inside the compare callout's white
   box (style.css .compare-callout, a two-column grid), across both columns
   under its text and button, edge to edge like the rest of the box (the line
   is otherwise shrunk to its text and centred). The callout's own gap is
   48 px (22 px on phones), which is more air than the line needs above it. */
.compare-callout > .coc-sponsor-slot { grid-column: 1 / -1; padding: 0; margin-top: -16px; min-width: 0; }
.compare-callout > .coc-sponsor-slot .coc-sponsor.coc-sponsor--line { width: auto; max-width: none; margin: 0; }
.compare-callout > .coc-sponsor-slot .coc-sponsor-line__proof { margin-left: auto; }
@media (max-width: 768px) { .compare-callout > .coc-sponsor-slot { margin-top: 0; } }

/* A control that takes focus scrolls clear of the sticky header, the same
   offset the site gives its own anchor targets (new-home.css). */
.coc-sponsor :is(a, button, input), .coc-sponsor__done { scroll-margin-top: calc(var(--nh-header-h, 72px) + 24px); }
/* While the phone bar shows, focus moves and anchors clear the bar as well. */
html.coc-sponsor-bar-on { scroll-padding-bottom: 104px; }

/* ---- card frame: pink fill, red border, never styled like a data card ---- */
.coc-sponsor {
  background: var(--sp-pink);
  border: 2px solid var(--sp-red);
  border-radius: 14px;
  padding: 20px;
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.coc-sponsor__q { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; color: var(--sp-ink); letter-spacing: 0; line-height: 1.3; }
.coc-sponsor__who { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.coc-sponsor__id { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.coc-sponsor__avatar {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--sp-red); color: #fff; font-weight: 700; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.coc-sponsor__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coc-sponsor__name { font-size: 1.05rem; font-weight: 700; margin: 2px 0 0; color: var(--sp-ink); }
/* RECA: the brokerage name in full and "clearly indicated": about the size
   of the agent's name, near-black, never a faint caption. */
.coc-sponsor__brokerage { font-size: 1rem; margin: 2px 0 0; color: var(--sp-text); font-weight: 600; }
/* The agent's own line (broker-approved): marks the card as their message. */
.coc-sponsor__line { font-size: 0.92rem; margin: 6px 0 0; color: var(--sp-text); }

/* ---- award badge: the agent's own, uploaded on the Sponsor card screen ----
   Under the name block on phones and on the lower card; beside it on the
   compact card from 900 px. The dark tile is for badges drawn with white text. */
.coc-sponsor__who { flex-wrap: wrap; }
.coc-sponsor__proof { flex: 0 0 100%; padding-left: 64px; line-height: 0; }
.coc-sponsor__proof img { display: block; height: 76px; width: auto; max-width: 100%; }
.coc-sponsor__proof--dark img, .coc-sponsor-line__proof--dark img { background: #1a1a1a; border-radius: 10px; padding: 6px; box-sizing: border-box; }
.coc-sponsor__proof--dark img { height: 92px; }

/* Call is the one solid button; Email and Website are outlined.
   The row wraps, so nothing sticks out at 320 px (WCAG 1.4.10). */
.coc-sponsor__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.coc-sponsor__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 12px; border-radius: 10px;
  background: var(--sp-red); color: #fff; font-weight: 600; font-size: 0.95rem; line-height: 1.2;
  text-decoration: none; border: 2px solid var(--sp-red); cursor: pointer; white-space: nowrap;
  flex: 1 1 0; min-width: max-content;
}
.coc-sponsor__btn:hover { background: var(--sp-red-hover); border-color: var(--sp-red-hover); color: #fff; }
.coc-sponsor__btn--ghost { background: #fff; color: #b91c1c; }
.coc-sponsor__btn--ghost:hover { background: #fff5f5; color: #991b1b; border-color: #b91c1c; }
.coc-sponsor__btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.coc-sponsor__btn .num { display: none; }

.coc-sponsor :focus-visible, .coc-sheet :focus-visible { outline: 3px solid var(--sp-focus); outline-offset: 2px; }
/* The site-wide ring (.nh-main a:focus-visible in new-home.css: 2 px, light
   blue) is more specific than the rule above and loads later, so links,
   buttons and fields are named here with an element selector to win. */
aside.coc-sponsor :is(a, button, input):focus-visible,
div.coc-sheet :is(a, button, input):focus-visible { outline: 3px solid var(--sp-focus); outline-offset: 2px; }

/* ---- fold button: looks like a button, not fine print ---- */
.coc-sponsor__reveal {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; min-height: 46px; padding: 10px 14px;
  border: 1.5px solid var(--sp-ink); border-radius: 10px; background: #fff;
  font: inherit; font-weight: 600; font-size: 0.95rem; color: var(--sp-ink); text-align: left; cursor: pointer;
}
.coc-sponsor__reveal .chev { color: var(--sp-ink); font-size: 1rem; transition: transform 0.15s; }
.coc-sponsor.is-open .coc-sponsor__reveal .chev { transform: rotate(180deg); }

/* ---- form (card and bottom sheet share these) ---- */
.coc-sponsor__form { margin: 14px 0 0; }
.coc-sponsor__form-lead { font-weight: 600; font-size: 0.95rem; margin: 0 0 10px; color: var(--sp-ink); }
.coc-sponsor__fields { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start; }
.coc-sponsor__field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--sp-text); margin: 0 0 4px; }
.coc-sponsor__form .opt { font-weight: 400; color: var(--sp-body); }
.coc-sponsor__hint { display: block; font-size: 0.8rem; color: var(--sp-body); margin-top: 3px; }
.coc-sponsor__field input {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px; margin: 0;
  font: inherit; font-size: 1rem;   /* 16 px: iOS does not zoom the page on focus */
  border: 1px solid #64748b; border-radius: 8px; background: #fff; color: var(--sp-ink);
}
.coc-sponsor__field input[aria-invalid="true"] { border: 2px solid #b91c1c; }
.coc-sponsor__error { display: block; font-size: 0.85rem; font-weight: 600; color: #991b1b; }
.coc-sponsor__error:not(:empty) { margin-top: 4px; }
.coc-sponsor__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; padding: 0; border: 0; min-width: 0; }
.coc-sponsor__chips legend { font-size: 0.85rem; font-weight: 600; color: var(--sp-text); margin-bottom: 6px; padding: 0; }
.coc-sponsor__chip { position: relative; display: inline-flex; margin: 0; }
.coc-sponsor__chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.coc-sponsor__chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid #64748b; background: #fff; font-size: 0.92rem; font-weight: 500; color: var(--sp-ink);
}
.coc-sponsor__chip input:checked + span { background: var(--sp-ink); color: #fff; border-color: var(--sp-ink); }
.coc-sponsor__chip input:checked + span::before { content: "\2713\00a0"; }
.coc-sponsor__chip input:focus-visible + span { outline: 3px solid var(--sp-focus); outline-offset: 2px; }
/* Honeypot: off screen, never display:none (some scripts skip hidden fields). */
.coc-sponsor__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.coc-sponsor__consent { font-size: 0.85rem; color: var(--sp-text); margin: 12px 0 10px; line-height: 1.45; }
/* The site's link styles drop the underline; this link keeps it (WCAG 1.4.1). */
.coc-sponsor__consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.coc-sponsor__submit {
  display: block; width: 100%; min-height: 46px; padding: 8px 14px; line-height: 1.3; border-radius: 10px; border: 2px solid transparent;
  background: var(--sp-ink); color: #fff; font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer;
}
.coc-sponsor__submit:hover { background: #000; }
.coc-sponsor__submit[aria-disabled="true"] { opacity: 0.7; cursor: progress; }

/* ---- modes ---- */
/* compact: the form sits behind the button at every width (top slots).
   auto: the same below 900 px; open beside the agent from 900 px (lower slots). */
.coc-sponsor .coc-sponsor__form { display: none; }
.coc-sponsor.is-open .coc-sponsor__form { display: block; }
.coc-sponsor .coc-sponsor__form-lead { display: none; }   /* the button already says it */

/* ---- sent + send failed ---- */
.coc-sponsor__done { margin-top: 14px; padding: 14px; border-radius: 10px; background: #fff; border: 1px solid #86efac; color: var(--sp-text); font-size: 0.95rem; }
.coc-sponsor__done strong { color: #166534; }
.coc-sponsor__done a { color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.coc-sponsor__done:focus { outline: 3px solid var(--sp-focus); outline-offset: 2px; }
/* The alert box is in the page from the start, so a screen reader announces
   it when it is filled. Empty, it takes no room. */
.coc-sponsor__err { color: #991b1b; font-size: 0.92rem; font-weight: 500; }
.coc-sponsor__err:not(:empty) { margin: 0 0 10px; padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid #fca5a5; }

@media (min-width: 900px) {
  .coc-sponsor .coc-sponsor__btn .num { display: inline; }
  .coc-sponsor .coc-sponsor__btn .lbl-call { display: none; }
  .coc-sponsor__btn { flex: 0 0 auto; }
  .coc-sponsor .coc-sponsor__fields { grid-template-columns: 1fr 1fr 1fr; }
  .coc-sponsor .coc-sponsor__fields .span-all { grid-column: 1 / -1; }

  /* compact on desktop: agent left, buttons right, fold button under */
  .coc-sponsor--compact { max-width: none; padding: 18px 24px; }
  .coc-sponsor--compact .coc-sponsor__main { display: grid; grid-template-columns: 1fr auto; column-gap: 24px; align-items: center; }
  .coc-sponsor--compact .coc-sponsor__q, .coc-sponsor--compact .coc-sponsor__reveal { grid-column: 1 / -1; }
  .coc-sponsor--compact .coc-sponsor__who { margin-bottom: 0; flex-wrap: nowrap; }
  .coc-sponsor--compact .coc-sponsor__id { flex: 0 1 auto; }
  .coc-sponsor--compact .coc-sponsor__proof { flex: 0 0 auto; padding-left: 0; margin-left: 12px; align-self: center; }
  .coc-sponsor--auto .coc-sponsor__proof img { height: 88px; }
  .coc-sponsor--auto .coc-sponsor__proof--dark img { height: 104px; }

  /* auto on desktop: agent left, form open on the right, no fold button */
  .coc-sponsor--auto { max-width: none; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.15fr); gap: 28px; padding: 24px 28px; }
  .coc-sponsor--auto .coc-sponsor__reveal { display: none; }
  .coc-sponsor--auto .coc-sponsor__form { display: block; margin-top: 0; padding-left: 28px; border-left: 1px solid var(--sp-rule); }
  .coc-sponsor--auto .coc-sponsor__form-lead { display: block; }
  .coc-sponsor--auto > .coc-sponsor__done { margin-top: 0; align-self: start; }
}

/* =============================================================================
   Photo layout (Spencer, 2026-11-26): used when a wide team photo is uploaded
   on the Sponsor card screen. The photo runs edge to edge; the name and the
   brokerage sit in white on its darkened lower edge, the brokerage about as
   large as the name (RECA). Without a team photo none of this applies and the
   round headshot layout above is used.
   Mockup: plans/mockups/sponsor-team-photo/.
   ============================================================================= */
.coc-sponsor__team { position: relative; margin: 0; background: #1a1a1a; overflow: hidden; line-height: 0; aspect-ratio: 172 / 95; }
.coc-sponsor__team img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.coc-sponsor__team::after { content: ""; position: absolute; inset: 45% 0 0 0; background: linear-gradient(to bottom, rgba(17,17,17,0) 0%, rgba(17,17,17,0.82) 62%, rgba(17,17,17,0.94) 100%); }
.coc-sponsor__team-id { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 20px 14px; line-height: 1.3; overflow-wrap: anywhere; }
.coc-sponsor__team-id .coc-sponsor__name { color: #fff; font-size: 1.15rem; font-weight: 700; margin: 0; }
.coc-sponsor__team-id .coc-sponsor__brokerage { color: #fff; font-size: 1rem; font-weight: 600; margin: 2px 0 0; }
.coc-sponsor__team-rule { display: block; width: 44px; height: 3px; background: #c9a665; margin: 0 0 8px; }

.coc-sponsor--photo { padding: 0; overflow: hidden; }
.coc-sponsor--photo .coc-sponsor__body { padding: 16px 20px 20px; }
.coc-sponsor--photo .coc-sponsor__q { margin-bottom: 6px; }
.coc-sponsor--photo .coc-sponsor__who { display: block; }
.coc-sponsor--photo .coc-sponsor__line { margin: 0; }
.coc-sponsor--photo .coc-sponsor__proof { padding-left: 0; margin-top: 12px; }
.coc-sponsor--photo .coc-sponsor__form { padding: 0 20px 20px; margin-top: 0; }
.coc-sponsor--photo > .coc-sponsor__done { margin: 0 20px 20px; }
.compare-callout > .coc-sponsor-slot .coc-sponsor--photo { border-radius: 14px; }

@media (min-width: 900px) {
  /* full card: photo and agent on the left, the form open on the right */
  .coc-sponsor--auto.coc-sponsor--photo { padding: 0; gap: 0; }
  .coc-sponsor--auto.coc-sponsor--photo .coc-sponsor__team-id { padding: 0 28px 16px; }
  .coc-sponsor--auto.coc-sponsor--photo .coc-sponsor__body { padding: 18px 28px 24px; }
  .coc-sponsor--auto.coc-sponsor--photo .coc-sponsor__form { padding: 24px 28px; }
  .coc-sponsor--auto.coc-sponsor--photo > .coc-sponsor__done { margin: 24px 28px; }

  /* compact card: the photo down the left end with the name and brokerage on
     it; beside it, centred, the question, the agent's line, the badge and the
     buttons (Spencer, 2026-11-26) */
  .coc-sponsor--compact.coc-sponsor--photo { padding: 0; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__main { grid-template-columns: minmax(0, 490px) minmax(0, 1fr); column-gap: 0; align-items: stretch; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__team { aspect-ratio: auto; min-height: 270px; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__team img { position: absolute; inset: 0; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__team-id { padding: 0 22px 16px; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__body {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px 28px;
  }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__q { font-size: 1.2rem; margin: 0 0 6px; text-wrap: balance; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__who { display: block; margin: 0 0 16px; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__line { font-size: 1rem; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__proof { margin: 12px 0 0; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__proof img { margin: 0 auto; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__actions { justify-content: center; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__reveal { margin-top: 14px; }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__form { padding: 4px 24px 20px; }
}
/* Between 900 and 1099 px the compact card's right side is narrow, so the
   photo panel is narrower and the badge is left to the full card. */
@media (min-width: 900px) and (max-width: 1099px) {
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__main { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }
  .coc-sponsor--compact.coc-sponsor--photo .coc-sponsor__proof { display: none; }
}

/* sponsor line: a small picture beside the words on a phone; from 900 px the
   photo fills the line's left end, edge to edge */
.coc-sponsor-line__photo { flex: 0 0 104px; width: 104px; aspect-ratio: 172 / 95; border-radius: 8px; overflow: hidden; background: #1a1a1a; line-height: 0; align-self: flex-start; margin-top: 3px; }
.coc-sponsor-line__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
@media (min-width: 900px) {
  aside.coc-sponsor.coc-sponsor--line-photo { padding-left: 0; overflow: hidden; align-items: stretch; }
  .coc-sponsor--line-photo .coc-sponsor-line__photo { position: relative; flex-basis: 150px; width: 150px; aspect-ratio: auto; border-radius: 0; margin: -10px 4px -10px 0; align-self: stretch; }
  .coc-sponsor--line-photo .coc-sponsor-line__photo img { position: absolute; inset: 0; }
  .coc-sponsor--line-photo .coc-sponsor-line__text, .coc-sponsor--line-photo .coc-sponsor-line__proof { align-self: center; }
}

/* home evaluation popup: the photo across the top, the close button on it */
.coc-heval-dialog--photo { position: fixed; }
.coc-heval-dialog--photo .coc-heval-dialog__team { margin: -14px -20px 14px; }
.coc-heval-dialog--photo .coc-heval-dialog__head { display: block; }
.coc-heval-dialog--photo .coc-heval-dialog__title { margin: 0; }
.coc-heval-dialog--photo .coc-heval-dialog__x {
  position: absolute; top: 10px; right: 10px; z-index: 2; border-radius: 50%;
  background: rgba(17, 17, 17, 0.72); color: #fff;
}
div.coc-heval-dialog--photo button.coc-heval-dialog__x:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.coc-heval-dialog--photo .coc-heval-dialog__what { margin-top: 6px; }
@media (min-width: 768px) {
  .coc-heval-dialog--photo .coc-heval-dialog__team { margin: -20px -26px 16px; }
  .coc-heval-dialog--photo .coc-sponsor__team-id { padding: 0 26px 14px; }
}
@media (forced-colors: active) {
  .coc-sponsor__team::after { display: none; }
  .coc-sponsor__team-id { position: static; padding: 10px 20px; background: Canvas; }
  .coc-sponsor__team-id .coc-sponsor__name, .coc-sponsor__team-id .coc-sponsor__brokerage { color: CanvasText; }
  .coc-sponsor__team { aspect-ratio: auto; }
}

/* ---- sponsor line (/address/ under the search hero; /neighbourhoods/ in the compare callout) ----
   Markup: template-parts/sponsor-line.php. The card's pink fill and red
   border on one slim box, shrunk to its text and centred. No question, no
   buttons, no form: one link down to the full card on the same page.
   RECA: the brokerage is the same size and weight as the agent's name; the
   team name is smaller than both. */
.coc-sponsor-slot--line { padding: 18px 0 2px; }
.coc-sponsor.coc-sponsor--line {
  display: flex; align-items: center; gap: 12px;
  width: fit-content; max-width: 100%; margin: 0 auto; padding: 10px 18px;
}
.coc-sponsor-line__avatar { flex: 0 0 44px; width: 44px; height: 44px; font-size: 0.95rem; }
.coc-sponsor-line__text { min-width: 0; overflow-wrap: anywhere; }
.coc-sponsor-line__lead { margin: 0; font-size: 0.98rem; line-height: 1.4; color: var(--sp-text); }
/* inline-block: a name that does not fit the rest of a line moves down whole
   instead of splitting ("Century 21 / Bamber"); a longer one still wraps. */
.coc-sponsor-line__name, .coc-sponsor-line__brokerage { display: inline-block; max-width: 100%; font-size: 1em; font-weight: 700; color: var(--sp-ink); }
/* Below 900 px each part takes its own line and the dots go, so no dot is
   left hanging at the end of a line. */
@media (max-width: 899px) {
  .coc-sponsor-line__dot { display: none; }
  .coc-sponsor-line__brokerage, .coc-sponsor-line__team { display: block; }
}
.coc-sponsor-line__sub { margin: 2px 0 0; font-size: 0.9rem; line-height: 1.4; color: var(--sp-text); }
.coc-sponsor-line__team { font-weight: 600; }
/* The site's link styles drop the underline; this link keeps it (WCAG 1.4.1). */
.coc-sponsor-line__contact { display: inline-block; padding: 3px 0; color: #b91c1c; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.coc-sponsor-line__contact:hover { color: #991b1b; }
/* The agent's award badge at the end of the line. Below 600 px it is left to
   the full card, so the line stays short on a phone. */
.coc-sponsor-line__proof { flex: 0 0 auto; line-height: 0; margin-left: 4px; }
.coc-sponsor-line__proof img { display: block; height: 54px; width: auto; }
.coc-sponsor-line__proof--dark img { border-radius: 8px; padding: 4px; }
@media (max-width: 599px) { .coc-sponsor-line__proof { display: none; } }
/* The full card the line links to: the anchor takes focus only so a screen
   reader lands on it, so it shows no ring of its own. */
.coc-sponsor[tabindex="-1"]:focus { outline: none; }

/* The line's bold opening question (Spencer, 2026-11-26), then the name row. */
.coc-sponsor-line__q { margin: 0 0 3px; font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--sp-ink); }
/* Between 900 and 1099 px the name row is too long for one line: the link takes its own line and its dot goes. */
@media (min-width: 900px) and (max-width: 1099px) {
  .coc-sponsor-line__dot--link { display: none; }
  .coc-sponsor-line__lead .coc-sponsor-line__contact { display: block; width: fit-content; }
}
.coc-sponsor-line__lead .coc-sponsor-line__team { font-size: 0.92em; }

/* The line's three buttons (Spencer, 2026-11-26). Below 900 px they take the
   full width under the photo and the words; from 900 px they sit under the
   words, beside a larger photo. */
aside.coc-sponsor.coc-sponsor--line { flex-wrap: wrap; row-gap: 12px; }
.coc-sponsor-line__main { display: contents; }
.coc-sponsor-line__text { flex: 1 1 0; }
.coc-sponsor-line__actions { flex: 0 0 100%; order: 3; }
@media (min-width: 900px) {
  aside.coc-sponsor.coc-sponsor--line { flex-wrap: nowrap; }
  .coc-sponsor-line__main { display: block; flex: 0 1 auto; min-width: 0; }
  .coc-sponsor-line__actions { margin-top: 10px; }
  .coc-sponsor-line__actions .coc-sponsor__btn { min-height: 40px; padding: 7px 12px; }
  .coc-sponsor--line-photo .coc-sponsor-line__photo { flex-basis: 232px; width: 232px; margin: -10px 6px -10px 0; }
  .coc-sponsor--line-photo .coc-sponsor-line__main { align-self: center; padding: 4px 0; }
}

/* ---- phone bar (address + community profiles, below 768 px) ---- */
/* No avatar and no ellipsis: RECA needs the brokerage name in full, so the
   name block wraps to a second line and is never cut off. */
.coc-sponsor-bar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 12px;
  background: #fff; border: 2px solid var(--color-primary, #cf2627); border-radius: 16px;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.18);
  font-family: var(--font, 'Inter', -apple-system, sans-serif);
  box-sizing: border-box;
}
.coc-sponsor-bar * { box-sizing: border-box; }
.coc-sponsor-bar__who { min-width: 0; flex: 1 1 0; overflow-wrap: anywhere; }
.coc-sponsor-bar__name { font-weight: 700; font-size: 0.85rem; color: #1a1a1a; margin: 0; line-height: 1.25; }
.coc-sponsor-bar__brokerage { font-size: 0.8rem; font-weight: 600; color: #1e293b; margin: 1px 0 0; line-height: 1.25; }
.coc-sponsor-bar__btn {
  flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 10px;
  background: var(--color-primary, #cf2627); color: #fff; font: inherit; font-weight: 600; font-size: 0.9rem; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
}
.coc-sponsor-bar__btn:hover { color: #fff; }
.coc-sponsor-bar__btn--ghost { background: #fff; color: #1a1a1a; border: 1.5px solid #1a1a1a; }
.coc-sponsor-bar__btn--ghost:hover { color: #1a1a1a; }
.coc-sponsor-bar__x { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: #475569; font-size: 1.4rem; line-height: 1; cursor: pointer; }
/* A hidden bar must not take focus, so it is visibility:hidden, not only moved off screen. */
.coc-sponsor-bar { visibility: hidden; transform: translateY(150%); transition: transform 0.24s ease-out, visibility 0s 0.24s; }
.coc-sponsor-bar.is-visible { visibility: visible; transform: none; transition: transform 0.24s ease-out; }
.coc-sponsor-bar[hidden] { display: none !important; }
aside.coc-sponsor-bar :is(a, button):focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
/* Narrow phones: name and brokerage on row 1, buttons on row 2. */
@media (max-width: 374px) {
  .coc-sponsor-bar { flex-wrap: wrap; }
  .coc-sponsor-bar__who { flex-basis: 100%; }
  .coc-sponsor-bar__btn { flex: 1 1 0; }
}
@media (min-width: 768px) { .coc-sponsor-bar, .coc-sheet, .coc-sheet-backdrop { display: none !important; } }
/* Room at the end of a community profile so the bar never covers the last
   lines (address profiles already reserve this for their pill). */
@media (max-width: 767px) { html.coc-sponsor-bar-on body:not(.single-address_profile) { padding-bottom: 96px; } }

/* ---- bottom sheet opened by the bar's Message button ---- */
.coc-sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 1040; }  /* above .site-header (1000), below the nav overlay (1050) */
.coc-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1045; max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff; border-radius: 18px 18px 0 0; padding: 14px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.25); border-top: 3px solid var(--color-primary, #cf2627);
  text-align: left;
}
.coc-sheet[hidden], .coc-sheet-backdrop[hidden] { display: none !important; }
.coc-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.coc-sheet__title { font-weight: 700; font-size: 1.05rem; margin: 0; color: var(--sp-ink); }
.coc-sheet__x { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: #475569; cursor: pointer; }
.coc-sheet__who { margin: 2px 0 10px; font-size: 0.92rem; font-weight: 600; color: #1e293b; }
.coc-sheet .coc-sheet__form { display: block; margin-top: 4px; }
.coc-sheet .coc-sponsor__done { margin-top: 6px; }
html.coc-sheet-open { overflow: hidden; }

/* =============================================================================
   Home evaluation button and popup (address profiles; 2026-11-25)
   Markup: template-parts/sponsor-evaluation.php. Behaviour: js/sponsor-card.js.
   The button sits under the assessed value in the quick-facts band. It wears
   the card's red outline, so it reads as part of the agent's ad and never as
   one of the page's own data controls.
   ============================================================================= */
.coc-heval { margin-top: 14px; max-width: 420px; font-family: var(--font, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif); }
.coc-heval__btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 14px;
  background: #fff; color: #b91c1c; border: 2px solid var(--color-primary, #cf2627); border-radius: 10px;
  font: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.25; text-align: left; cursor: pointer;
  scroll-margin-top: calc(var(--nh-header-h, 72px) + 24px);
}
.coc-heval__btn:hover { background: #fff5f5; color: #991b1b; border-color: #b91c1c; }
.coc-heval__arrow { flex: 0 0 auto; }
/* Named with element selectors to beat the site-wide ring (see the note above). */
div.coc-heval button.coc-heval__btn:focus-visible,
div.coc-heval-dialog :is(a, button, input):focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }

/* The popup: a bottom sheet on phones, a centred panel from 768 px. */
.coc-heval-dialog {
  --sp-red: var(--color-primary, #cf2627);
  --sp-pink: var(--color-pink-bg, #fef2f2);
  --sp-ink: var(--color-dark, #1a1a1a);
  --sp-text: #1e293b;
  --sp-body: #475569;
  --sp-rule: #f3c6c6;
  --sp-focus: #1d4ed8;
  font-family: var(--font, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  line-height: 1.4; color: var(--sp-ink); text-align: left;
  position: fixed; z-index: 1045; left: 0; right: 0; bottom: 0;
  max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 18px 18px 0 0; border-top: 3px solid var(--sp-red);
  padding: 14px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.25);
}
.coc-heval-dialog *, .coc-heval-dialog *::before, .coc-heval-dialog *::after { box-sizing: border-box; }
.coc-heval-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 1040; }
.coc-heval-dialog[hidden], .coc-heval-backdrop[hidden] { display: none !important; }
@media (min-width: 768px) {
  .coc-heval-dialog {
    left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
    border-radius: 16px; border: 2px solid var(--sp-red); padding: 20px 26px 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  }
}
.coc-heval-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.coc-heval-dialog__title { font-weight: 700; font-size: 1.15rem; line-height: 1.3; margin: 8px 0 0; color: var(--sp-ink); }
.coc-heval-dialog__x { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: #475569; cursor: pointer; }
/* The agent as on the card: headshot or initials, the name, and the brokerage
   in full at about the same size, never a faint caption (RECA). */
.coc-heval-dialog__agent { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 0; }
.coc-heval-dialog__id { min-width: 0; overflow-wrap: anywhere; }
.coc-heval-dialog__name { font-size: 1.05rem; font-weight: 700; margin: 2px 0 0; color: var(--sp-ink); }
.coc-heval-dialog__brokerage { font-size: 1rem; font-weight: 600; margin: 2px 0 0; color: var(--sp-text); }
.coc-heval-dialog__what { margin: 8px 0 14px; font-size: 0.9rem; color: var(--sp-body); }
.coc-heval-dialog .coc-heval-form { display: block; margin: 0; }

/* "Which home": the tick box first, the typed address as the other way. */
.coc-heval-home { display: grid; gap: 10px; margin: 0 0 14px; padding: 12px 14px 14px; background: var(--sp-pink); border: 1px solid var(--sp-rule); border-radius: 12px; }
.coc-heval-check { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; cursor: pointer; }
.coc-heval-check input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.coc-heval-check__box { flex: 0 0 26px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #475569; border-radius: 6px; background: #fff; }
.coc-heval-check input:checked + .coc-heval-check__box { background: var(--sp-ink); border-color: var(--sp-ink); }
.coc-heval-check input:checked + .coc-heval-check__box::after { content: "\2713"; color: #fff; font-weight: 700; font-size: 1rem; line-height: 1; }
.coc-heval-check input:focus-visible + .coc-heval-check__box { outline: 3px solid var(--sp-focus); outline-offset: 2px; }
.coc-heval-check__lbl { font-size: 1.02rem; font-weight: 700; color: var(--sp-ink); }
.coc-heval-confirm { margin: 0; font-size: 0.92rem; color: var(--sp-text); overflow-wrap: anywhere; }
.coc-heval-confirm[hidden], .coc-heval-unit[hidden], .coc-heval-home [data-heval-typed][hidden] { display: none; }
.coc-heval-unit input { max-width: 160px; }
.coc-heval-fields { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .coc-heval-fields { grid-template-columns: 1fr 1fr; }
  .coc-heval-fields .span-all { grid-column: 1 / -1; }
}
.coc-heval-dialog .coc-sponsor__done { margin-top: 6px; }
html.coc-heval-open { overflow: hidden; }
/* The phone bar never sits on top of the open popup. */
html.coc-heval-open .coc-sponsor-bar { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .coc-sponsor-bar, .coc-sponsor-bar.is-visible, .coc-sheet, .coc-sponsor__reveal .chev { transition: none !important; }
}

/* Forced colours: the selected chip and the button edges stay visible. */
@media (forced-colors: active) {
  .coc-sponsor__chip input:checked + span { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .coc-sponsor, .coc-sponsor__btn, .coc-sponsor__reveal, .coc-sponsor__submit, .coc-sponsor-bar, .coc-sponsor-bar__btn { border-color: CanvasText; }
  .coc-heval__btn, .coc-heval-dialog, .coc-heval-check__box { border-color: CanvasText; }
  .coc-heval-check input:checked + .coc-heval-check__box { forced-color-adjust: none; background: Highlight; border-color: Highlight; }
}

/* =============================================================================
   Home evaluation panel: the sponsor's half of the "What's your address
   worth?" box on community profiles (template-parts/sponsor-evaluation.php,
   part = panel). The box's own half keeps its look; the panel is the pink
   tile of the card, so it reads as the agent's ad. Beside the lookup from
   900 px, under it below.
   ============================================================================= */
.address-cta-card--sponsor { flex-wrap: wrap; }
.coc-heval-panel {
  flex: 1 1 100%; min-width: 0; box-sizing: border-box; padding: 18px 20px;
  background: var(--sp-pink); border: 1px solid var(--sp-rule); border-radius: 12px;
  font-family: var(--font, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  scroll-margin-top: calc(var(--nh-header-h, 72px) + 24px);
}
.coc-heval-panel * { box-sizing: border-box; }
.coc-heval-panel__q { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin: 0 0 6px; color: var(--sp-ink); }
.coc-heval-panel__what { font-size: 0.92rem; line-height: 1.5; margin: 0 0 14px; color: var(--sp-text); }
.coc-heval-panel__agent { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; }
.coc-heval-panel__id { min-width: 0; overflow-wrap: anywhere; }
.coc-heval-panel__name { font-size: 1.05rem; font-weight: 700; margin: 2px 0 0; color: var(--sp-ink); }
.coc-heval-panel__brokerage { font-size: 1rem; font-weight: 600; line-height: 1.35; margin: 2px 0 0; color: var(--sp-text); }
.coc-heval-panel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.coc-heval-panel .coc-heval { margin-top: 0; max-width: none; }
.coc-heval-panel .coc-heval__btn { background: var(--sp-red); color: #fff; border-color: var(--sp-red); }
.coc-heval-panel .coc-heval__btn:hover { background: var(--sp-red-hover); border-color: var(--sp-red-hover); color: #fff; }
.coc-heval-panel__call { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.95rem; font-weight: 600; color: #b91c1c; text-decoration: underline; text-underline-offset: 3px; }
.coc-heval-panel__call:hover { color: #991b1b; }
aside.coc-heval-panel a.coc-heval-panel__call:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
@media (min-width: 900px) {
  .address-cta-card--sponsor { flex-wrap: nowrap; align-items: stretch; }
  .address-cta-card--sponsor .address-cta-content { flex: 1 1 0; }
  .coc-heval-panel { flex: 0 1 400px; align-self: center; }
}
@media (forced-colors: active) { .coc-heval-panel { border-color: CanvasText; } }

/* The card is an ad for the agent, not part of the profile: keep it out of the PDF. */
@media print {
  .coc-sponsor-slot, .coc-sponsor-bar, .coc-sheet, .coc-sheet-backdrop,
  .coc-heval, .coc-heval-panel, .coc-heval-dialog, .coc-heval-backdrop { display: none !important; }
}
