/* ── Neighbourhood census block (rucn-) ─────────────────────────────────────
   Append to roofup-property-detail.css
   Mobile-first. Zero hardcoded colors. Zero font-family. Zero icon fonts.
   --------------------------------------------------------------------------- */

.rucn-block { font-size: 13px; }

/* Header */
.rucn-hdr { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.rucn-title { font-size: 15px; font-weight: 600; color: var(--c-ink); }
.rucn-badge { font-size: 11px; color: var(--c-ink-muted); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 2px 9px; white-space: nowrap; }

/* Tab nav — horizontal scroll on mobile, no scrollbar visible.
   Scoped to .rucn-block to override any overflow:hidden in pd-tab-nav
   from the parent plugin stylesheet. */
.rucn-block .pd-tab-nav {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
.rucn-block .pd-tab-nav::-webkit-scrollbar { display: none; }
.rucn-block .pd-tab-nav .pd-tab-btn { flex-shrink: 0; }

/* Stat cards — 2-column always, readable on smallest screens */
.rucn-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rucn-sc { background: var(--c-surface-2); border-radius: var(--radius-md); padding: 9px 11px; }
.rucn-sl { font-size: 11px; color: var(--c-ink-muted); line-height: 1.3; margin-bottom: 2px; }
.rucn-sv { font-size: 18px; font-weight: 700; color: var(--c-ink); line-height: 1.1; }
.rucn-ss { font-size: 11px; color: var(--c-ink-muted); margin-top: 2px; }

/* Section label */
.rucn-cl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-ink-muted); margin-bottom: 7px; }

/* Canvas wrapper */
.rucn-cw { position: relative; width: 100%; }

/* Alert banners */
.rucn-alert { border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 7px 11px; font-size: 12px; margin-bottom: 8px; background: var(--c-accent-bg); border-left: 2.5px solid var(--c-accent); color: var(--c-ink-soft); display: none; }
.rucn-alert-on { display: block; }
.rucn-alert b { font-weight: 600; color: var(--c-ink); }
.rucn-alert-w { background: var(--c-amber-bg); border-left-color: var(--c-amber); }

/* Summary scorecard rows — text tag instead of icon */
.rucn-score-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 0.5px solid var(--c-border); font-size: 12px; }
.rucn-score-row:last-child { border-bottom: none; }
.rucn-score-tag { font-size: 10px; font-weight: 600; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 2px 6px; color: var(--c-ink-soft); white-space: nowrap; flex-shrink: 0; min-width: 46px; text-align: center; }
.rucn-score-lbl { flex: 1; font-weight: 500; color: var(--c-ink); line-height: 1.2; }
.rucn-score-sub { display: block; font-size: 11px; color: var(--c-ink-muted); font-weight: 400; margin-top: 1px; }

/* Pills */
.rucn-pill { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.rucn-pill-g { background: var(--c-green-bg); color: var(--c-green); }
.rucn-pill-a { background: var(--c-amber-bg); color: var(--c-amber); }
.rucn-pill-r { background: var(--c-red-bg); color: var(--c-red); }

/* Inline bar charts */
.rucn-br { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; }
.rucn-brl { width: 90px; flex-shrink: 0; color: var(--c-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rucn-brt { flex: 1; background: var(--c-surface-3); border-radius: 3px; height: 6px; overflow: hidden; }
.rucn-brf { height: 100%; border-radius: 3px; transition: width var(--transition); }
.rucn-brv { width: 32px; text-align: right; font-weight: 600; font-size: 11px; color: var(--c-ink); }

/* Key-value rows (income bench, mobility) */
.rucn-kv { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 0.5px solid var(--c-border); font-size: 12px; }
.rucn-kv:last-child { border-bottom: none; }
.rucn-kv-l { color: var(--c-ink-soft); }
.rucn-kv-v { font-weight: 600; color: var(--c-ink); }

/* Source */
.rucn-src { font-size: 11px; color: var(--c-ink-muted); margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--c-border); }

/* Touch targets */
.rucn-block button, .rucn-block a { touch-action: manipulation; }

/* ── Desktop (600px+) ────────────────────────────────────────────────────── */
@media (min-width: 600px) {
    /* 4 stat cards in one row */
    .rucn-g2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    /* Summary tab: scorecard left, donut right */
    .rucn-summary-inner { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: start; }

    /* Detail tabs: two-column layout for bar sections */
    .rucn-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* Hide tenure donut on mobile — summary tab shows scores only */
.rucn-sum-donut-col { display: none; }
@media (min-width: 600px) {
    .rucn-sum-donut-col { display: block; }
}
