/* Bendygo Partner Portals — scoped to .bp-wrap so the theme is untouched. */
.bp-wrap {
  --bp-green: #2f8f46;
  --bp-green-dark: #22703a;
  --bp-green-soft: #e9f6ec;
  --bp-accent: #61ce70;
  --bp-ink: #1f2a24;
  --bp-muted: #5e6b63;
  --bp-line: #dfe6e1;
  --bp-bg: #f6f8f7;
  --bp-card: #ffffff;
  --bp-warn: #9a5b00;
  --bp-warn-soft: #fff4e0;
  --bp-bad: #b3261e;
  --bp-bad-soft: #fdecea;
  --bp-info: #1d5fa8;
  --bp-info-soft: #e8f0fb;
  --bp-radius: 10px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 0 48px;
  color: var(--bp-ink);
  font-size: 15px;
  line-height: 1.5;
  box-sizing: border-box;
}
.bp-wrap *, .bp-wrap *::before, .bp-wrap *::after { box-sizing: border-box; }
.bp-wrap a { color: var(--bp-green-dark); }
.bp-wrap a:hover { color: var(--bp-green); }

.bp-h2 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .25em; color: var(--bp-ink); text-transform: none; }
.bp-h3 { font-size: 1.15rem; margin: 0 0 .75em; color: var(--bp-ink); text-transform: none; }
.bp-h4 { font-size: 1rem; margin: 1.2em 0 .6em; color: var(--bp-ink); text-transform: none; display: flex; gap: 8px; align-items: center; }
.bp-eyebrow { margin: 0; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bp-green); font-weight: 600; }
.bp-muted { color: var(--bp-muted); }
.bp-small { font-size: .85rem; }
.bp-warn { color: var(--bp-warn); }
.bp-due { color: var(--bp-bad); font-weight: 600; }
.bp-empty { padding: 24px; text-align: center; color: var(--bp-muted); background: var(--bp-bg); border-radius: var(--bp-radius); }

.bp-card {
  background: var(--bp-card);
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius);
  padding: 20px 22px;
  margin: 0 0 18px;
}
.bp-subcard { border: 1px solid var(--bp-line); border-radius: var(--bp-radius); padding: 14px 16px; background: var(--bp-bg); margin-top: 12px; }
.bp-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bp-card__head .bp-h3 { margin: 0; }
.bp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.bp-cols > .bp-card { margin: 0 0 18px; }

/* Portal header + tabs */
.bp-portal__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 0 0 14px; }
.bp-portal__who { color: var(--bp-muted); font-size: .9rem; display: flex; gap: 12px; align-items: center; }
.bp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bp-line); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.bp-tabs::-webkit-scrollbar { display: none; }
.bp-tab { padding: 10px 14px; text-decoration: none; color: var(--bp-muted) !important; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.bp-tab:hover { color: var(--bp-ink) !important; }
.bp-tab.is-active { color: var(--bp-green-dark) !important; border-bottom-color: var(--bp-green); }

/* Notices */
.bp-notice { padding: 12px 16px; border-radius: var(--bp-radius); margin: 0 0 16px; border-left: 4px solid; }
.bp-notice--ok { background: var(--bp-green-soft); border-color: var(--bp-green); }
.bp-notice--error { background: var(--bp-bad-soft); border-color: var(--bp-bad); }

/* Badges */
.bp-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.bp-badge--ok { background: var(--bp-green-soft); color: var(--bp-green-dark); }
.bp-badge--warn { background: var(--bp-warn-soft); color: var(--bp-warn); }
.bp-badge--bad { background: var(--bp-bad-soft); color: var(--bp-bad); }
.bp-badge--info { background: var(--bp-info-soft); color: var(--bp-info); }
.bp-badge--muted { background: #eef1ef; color: var(--bp-muted); }

/* Stats + pipeline */
.bp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0 0 18px; }
.bp-stat { background: var(--bp-card); border: 1px solid var(--bp-line); border-radius: var(--bp-radius); padding: 16px 18px; display: flex; flex-direction: column; }
.bp-stat__n { font-size: 1.7rem; font-weight: 700; color: var(--bp-green-dark); line-height: 1.1; font-variant-numeric: tabular-nums; }
.bp-stat__l { color: var(--bp-muted); font-size: .85rem; margin-top: 4px; }
.bp-pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.bp-pipeline__step { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 8px; background: var(--bp-bg); text-decoration: none; color: var(--bp-muted) !important; font-size: .85rem; }
.bp-pipeline__step:hover { background: var(--bp-green-soft); }
.bp-pipeline__n { font-size: 1.3rem; font-weight: 700; color: var(--bp-ink); font-variant-numeric: tabular-nums; }

/* Onboarding */
.bp-onboard { border-left: 4px solid var(--bp-accent); }
.bp-steps { list-style: none; margin: 14px 0; padding: 0; counter-reset: s; }
.bp-steps li { counter-increment: s; position: relative; padding: 6px 0 6px 38px; }
.bp-steps li::before { content: counter(s); position: absolute; left: 0; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #eef1ef; color: var(--bp-muted); font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.bp-steps li.is-done::before { content: "✓"; background: var(--bp-green); color: #fff; }

/* Definition lists */
.bp-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; margin: 0; }
.bp-dl > div { min-width: 0; }
.bp-dl dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bp-muted); margin: 0; }
.bp-dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.bp-dl--compact { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); background: var(--bp-bg); padding: 12px; border-radius: 8px; margin: 10px 0; }

/* Tables */
.bp-table-wrap { overflow-x: auto; margin: 0 0 12px; }
.bp-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0; border: 0; }
.bp-table th, .bp-table td { padding: 10px 10px; border: 0; border-bottom: 1px solid var(--bp-line); text-align: left; vertical-align: top; background: transparent; }
.bp-table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bp-muted); font-weight: 600; background: var(--bp-bg); }
.bp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bp-table tfoot th, .bp-table tfoot td { border-bottom: 0; }
.bp-table tr.is-picked td { background: var(--bp-green-soft); }
.bp-rowactions { white-space: nowrap; }
.bp-rowactions form { display: inline; }
.bp-editrow td { background: var(--bp-bg); }

/* Forms */
.bp-form { margin: 0; }
.bp-fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.bp-fieldset legend { font-weight: 700; font-size: 1.05rem; margin: 0 0 10px; padding: 0; }
.bp-fieldset[hidden] { display: none; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin: 0 0 12px; }
.bp-field { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 500; color: var(--bp-ink); margin: 0 0 12px; }
.bp-grid .bp-field { margin: 0; }
.bp-field--wide { grid-column: 1 / -1; }
.bp-label { font-size: .88rem; font-weight: 500; }
.bp-wrap input[type=text], .bp-wrap input[type=email], .bp-wrap input[type=url], .bp-wrap input[type=tel],
.bp-wrap input[type=password], .bp-wrap input[type=number], .bp-wrap input[type=date], .bp-wrap input[type=search],
.bp-wrap select, .bp-wrap textarea {
  width: 100%; max-width: 100%; padding: 9px 11px; border: 1px solid #c9d3cc; border-radius: 7px; background: #fff;
  font: inherit; font-weight: 400; color: var(--bp-ink); min-height: 40px; box-shadow: none;
}
.bp-wrap textarea { min-height: 64px; }
.bp-wrap input:focus, .bp-wrap select:focus, .bp-wrap textarea:focus { outline: 2px solid var(--bp-accent); outline-offset: 1px; border-color: var(--bp-green); }
.bp-wrap fieldset:disabled input, .bp-wrap fieldset:disabled select, .bp-wrap input:disabled, .bp-wrap select:disabled { background: var(--bp-bg); color: var(--bp-muted); }
.bp-input-num { max-width: 110px; text-align: right; margin-left: auto; display: block; }
.bp-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.bp-checks--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.bp-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: .9rem; margin: 4px 0; }
.bp-check input { margin-top: 3px; flex: none; }
.bp-consent { margin: 8px 0 18px; padding: 12px 14px; background: var(--bp-bg); border-radius: 8px; }
.bp-hp { position: absolute !important; left: -9999px !important; height: 1px; overflow: hidden; }
.bp-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.bp-inline select, .bp-inline input { width: auto; min-width: 120px; }
.bp-inline label { display: flex; gap: 6px; align-items: center; font-size: .88rem; }
.bp-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; margin: 0 0 16px; }
.bp-filters label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 500; }
.bp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.bp-actions form { margin: 0; }
.bp-cartbar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; background: #fff; border-top: 1px solid var(--bp-line); padding: 12px 0; margin-top: 8px; }

/* Choice cards (sign-up) */
.bp-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.bp-choice__opt { display: flex; gap: 12px; padding: 14px 16px; border: 2px solid var(--bp-line); border-radius: var(--bp-radius); cursor: pointer; font-weight: 400; }
.bp-choice__opt:has(input:checked) { border-color: var(--bp-green); background: var(--bp-green-soft); }
.bp-choice__opt input { margin-top: 4px; flex: none; }
.bp-choice__opt span { display: flex; flex-direction: column; }
.bp-choice__opt small { color: var(--bp-muted); font-size: .85rem; }

/* Buttons */
.bp-wrap .bp-btn, .bp-wrap button.bp-btn, .bp-auth input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bp-green); color: #fff !important; border: 1px solid var(--bp-green); border-radius: 7px;
  padding: 10px 18px; font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; min-height: 40px;
}
.bp-wrap .bp-btn:hover, .bp-auth input[type=submit]:hover { background: var(--bp-green-dark); border-color: var(--bp-green-dark); color: #fff !important; }
.bp-wrap .bp-btn--sm, .bp-wrap button.bp-btn--sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.bp-wrap .bp-btn--lg, .bp-wrap button.bp-btn--lg { padding: 13px 26px; font-size: 1.05rem; }
.bp-wrap .bp-btn--ghost, .bp-wrap button.bp-btn--ghost { background: #fff; color: var(--bp-green-dark) !important; }
.bp-wrap .bp-btn--ghost:hover, .bp-wrap button.bp-btn--ghost:hover { background: var(--bp-green-soft); color: var(--bp-green-dark) !important; }
.bp-link-btn { background: none !important; border: 0 !important; padding: 0 !important; color: var(--bp-bad) !important; cursor: pointer; font: inherit; font-size: .88rem; text-decoration: underline; min-height: 0 !important; }

/* Lead detail: stage checklist + timeline */
.bp-stages { display: flex; flex-direction: column; gap: 6px; }
.bp-stage { border: 1px solid var(--bp-line); border-radius: 8px; background: #fff; }
.bp-stage > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; font-weight: 500; }
.bp-stage > summary::-webkit-details-marker { display: none; }
.bp-stage > summary::before { content: "▸"; color: var(--bp-muted); margin-right: 4px; }
.bp-stage[open] > summary::before { content: "▾"; }
.bp-stage > summary > span:first-child { flex: 1; }
.bp-stage > form { padding: 4px 14px 14px; }
.bp-stage--complete > summary { background: var(--bp-green-soft); }
.bp-disclosure > summary { cursor: pointer; font-weight: 600; color: var(--bp-green-dark); margin: 8px 0; }
.bp-timeline { list-style: none; margin: 14px 0 0; padding: 0; border-left: 2px solid var(--bp-line); max-height: 360px; overflow: auto; }
.bp-timeline li { padding: 6px 0 10px 14px; font-size: .9rem; }
.bp-timeline__meta { display: block; font-size: .78rem; color: var(--bp-muted); }

/* Auth */
.bp-auth { max-width: 460px; }
.bp-auth__card form p { margin: 0 0 12px; }
.bp-auth__card label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 4px; }
.bp-auth__card .login-remember label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.bp-auth__links { margin: 8px 0 0; font-size: .9rem; }

/* Mobile: tables collapse into labelled rows */
@media (max-width: 720px) {
  .bp-wrap { font-size: 15px; padding: 0 0 32px; }
  .bp-card { padding: 16px; }
  .bp-h2 { font-size: 1.35rem; }
  .bp-table thead { display: none; }
  .bp-table, .bp-table tbody, .bp-table tr, .bp-table td, .bp-table tfoot, .bp-table tfoot tr { display: block; width: 100%; }
  .bp-table tr { border: 1px solid var(--bp-line); border-radius: 8px; margin-bottom: 10px; padding: 6px 10px; }
  .bp-table td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .bp-table td[data-label]::before { content: attr(data-label); font-weight: 600; color: var(--bp-muted); font-size: .8rem; text-align: left; flex: none; }
  .bp-table td:not([data-label]) { justify-content: flex-start; }
  .bp-table .num { text-align: right; }
  .bp-table tfoot tr { border: 0; padding: 0; display: flex; justify-content: space-between; }
  .bp-table tfoot th, .bp-table tfoot td { display: inline; width: auto; padding: 4px 0; }
  .bp-input-num { max-width: 120px; }
  .bp-inline { flex-direction: column; align-items: stretch; }
  .bp-inline select, .bp-inline input { width: 100%; }
  .bp-cols { grid-template-columns: 1fr; }
  .bp-cartbar { flex-direction: column; align-items: stretch; }
}

/* Design tool */
.bp-callout { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; border-left: 4px solid var(--bp-accent); }
.bp-callout .bp-h3 { margin-bottom: 4px; }
.bp-callout p { margin: 0; }
.bp-stats--inline { margin-bottom: 14px; }
.bp-stat__n--sm { font-size: 1rem; }
.bp-result { background: var(--bp-bg); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; }
.bp-result p { margin: 0 0 6px; }
.bp-facets input[type=text] { min-width: 120px; }
.bp-facets .bp-input-num { max-width: 90px; }
/* Facet rows render as compact cards at every width (9 columns don't fit a content column). */
.bp-facets thead { display: none; }
.bp-facets, .bp-facets tbody { display: block; width: 100%; }
.bp-facets tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px 10px; align-items: end; border: 1px solid var(--bp-line); border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; background: #fff; }
.bp-facets td { display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; text-align: left !important; }
.bp-facets td[data-label]::before { content: attr(data-label); font-size: .75rem; font-weight: 600; color: var(--bp-muted); }
.bp-facets td[data-label="Roof face"] { grid-column: span 2; }
.bp-facets td[data-label="Result"] { grid-column: 1 / -1; font-size: .82rem; color: var(--bp-muted); flex-direction: row; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.bp-facets td:last-child { grid-column: 1 / -1; align-items: flex-end; }
.bp-facets .bp-input-num { max-width: none; width: 100%; text-align: left; margin: 0; }
@media (max-width: 720px) {
  .bp-facets tr { grid-template-columns: repeat(2, 1fr); }
  .bp-facets td { justify-content: flex-start; text-align: left; }
  .bp-facets td[data-label="Roof face"], .bp-facets td[data-label="Result"] { grid-column: 1 / -1; }
  .bp-facets td:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) { .bp-stats--inline { grid-template-columns: 1fr 1fr; gap: 8px; } .bp-stats--inline .bp-stat { padding: 10px 12px; } .bp-stats--inline .bp-stat__n { font-size: 1.25rem; } .bp-stats--inline .bp-stat__n--sm { font-size: .9rem; } }

/* ---- Satellite roof designer (v1.2) ---- */
.rd-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.rd-addr { flex: 1 1 240px; margin: 0; }
.rd-addr input { width: 100%; }
.rd-sep { width: 1px; align-self: stretch; background: #dde3de; margin: 0 4px; }
.bp-wrap .rd button.rd-when-tracing { display: none; }
.bp-wrap .rd.is-tracing button.rd-when-tracing { display: inline-flex; }
.bp-wrap .rd.is-tracing button[data-rd-trace], .bp-wrap .rd.is-tracing button[data-rd-addpanel] { display: none; }
.bp-wrap .rd.is-adding button[data-rd-addpanel] { background: var(--bp-green-soft); }
.rd-hint { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: #f3f7f4; font-size: .92rem; }
.rd-hint.is-warn { background: #fff4e0; color: #7a4b00; }
.rd-body { display: flex; flex-direction: column; gap: 12px; }
.rd-map { height: min(620px, 70vh); min-height: 380px; border-radius: 10px; overflow: hidden; background: #e6ebe7; }
.rd.is-tracing .rd-map, .rd.is-adding .rd-map { outline: 3px solid var(--bp-green, #2e7d32); }
.rd-side { display: flex; flex-direction: column; gap: 10px; }
.bp-stats.rd-summary { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0; }
.rd-summary .bp-stat { padding: 10px 12px; }
.rd-summary .bp-stat__n { font-size: 1.3rem; }
[data-rd-sections] { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rd-sec { border: 1px solid #dde3de; border-left: 5px solid var(--rd-color, #999); border-radius: 8px; padding: 10px 12px; background: #fff; }
.rd-sec.is-active { box-shadow: 0 0 0 2px var(--rd-color, #999); }
.rd-sec__head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.rd-sec__head .rd-name { flex: 1; min-width: 0; font-weight: 600; }
.rd-sec__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rd-sec__grid label { display: flex; flex-direction: column; font-size: .82rem; gap: 3px; margin: 0; }
.rd-sec__grid input, .rd-sec__grid select { width: 100%; min-width: 0; }
.rd-row { display: flex; gap: 4px; }
.rd-sec__m { margin: 8px 0; font-size: .86rem; }
.rd-savebar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 14px; }
.rd-savebar .bp-field { flex: 1 1 260px; margin: 0; }
[data-rd-sections] > p { grid-column: 1 / -1; margin: 0; }
.rd-sec__g { color: #1f5f2a; }
.rd-attrib { margin: 0; font: 400 12px/1.4 Roboto, Arial, sans-serif; color: #444; }
.rd-mapwrap { position: relative; }
.rd-cross { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; z-index: 2; }
.rd-cross::before, .rd-cross::after { content: ''; position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.55); }
.rd-cross::before { left: 12px; top: 0; width: 2px; height: 26px; }
.rd-cross::after { top: 12px; left: 0; width: 26px; height: 2px; }
.rd.is-tracing .rd-cross, .rd.is-adding .rd-cross { display: none; }
