/* Master reference: Share of Home Buyers by Primary Reason to Move, 2007–2026 */
:root { --blue:#006bb7; --coral:#ff7f61; --green:#319b76; --purple:#b03995; --teal:#077a8a; --ink:#333; --grid:#d3d9de; }
* { box-sizing:border-box; }
body { margin:0; background:#fff; color:var(--ink); font-family:"Montserrat",Arial,sans-serif; }
.container { max-width:1600px; margin:0 auto; padding:18px 24px 2px; }
.chart-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; width:100%; }
.chart-title { margin:0; flex:1 1 auto; min-width:0; font-family:inherit; font-size:34px; line-height:1.3; font-weight:700; letter-spacing:-.5px; }
.subtitle { margin:14px 0 24px; width:100%; font-size:23px; line-height:1.55; font-weight:400; color:#333; }
.tap-hint.fancy { display:inline-flex; align-items:center; justify-content:center; gap:7px; flex:0 0 auto; padding:7px 11px 7px 9px; background:linear-gradient(180deg,#fafafa,#ececec); border:1px solid #d8d8d8; border-radius:8px; box-shadow:0 1px 2px #0000000d,0 4px 10px #00000014; }
.icon-wrap { display:flex; align-items:center; justify-content:center; }
.tap-icon { display:inline-block; font-size:18px; line-height:1; color:#7a7a7a; transform:rotate(-12deg); }
.tap-text { font-size:10px; line-height:1.08; font-style:italic; font-weight:700; color:#6d6d6d; white-space:nowrap; }
.mobile-text { display:none; }
.filters { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:0 0 10px; padding-bottom:10px; border-bottom:1px solid #333; }
.filter { font:600 14px "Montserrat",Arial,sans-serif; color:#222; background:#fff; border:1px solid #c7c7c7; border-radius:999px; padding:9px 17px; cursor:pointer; transition:background .18s; }
.filter:hover { background:#f4f4f4; }
.filter.active,.filter.active:hover { background:#222; color:#fff; border-color:#222; }
.filter:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.chart-wrap { position:relative; width:100%; margin:0; }
svg { display:block; width:100%; height:auto; overflow:visible; font-family:"Montserrat",Arial,sans-serif; }
.grid line { stroke:var(--grid); stroke-dasharray:2 4; }
.grid path,.axis path { display:none; }
.axis text { fill:#555; font-size:13px; }
.axis line { display:none; }
.x-axis .tick line { display:block; stroke:#cbd2d7; stroke-width:1.1; }
.x-baseline { stroke:#aeb6bc; stroke-width:1; }
.series path { fill:none; stroke-linecap:round; stroke-linejoin:round; }
.dot { stroke:#fff; stroke-width:1.5; }
.end-label { font-size:13px; font-weight:700; paint-order:stroke fill; stroke:#fff; stroke-width:4px; stroke-linejoin:round; }
.focus-line { stroke:#888; stroke-width:1; stroke-dasharray:3 3; }
.tooltip { position:absolute; z-index:5; opacity:0; pointer-events:none; background:#fff; border:1px solid #dfe4e8; border-radius:9px; box-shadow:0 5px 22px #00000019; padding:11px 14px; min-width:235px; font-size:14px; line-height:1.55; }
.tooltip strong { font-size:15px; }
.tip-row { display:flex; justify-content:space-between; gap:18px; }
.tip-dot { width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:7px; }
.record-note { display:flex; align-items:flex-start; gap:9px; max-width:900px; margin:9px 0 22px; padding:10px 13px; background:#faf6fb; border-left:3px solid var(--purple); border-radius:5px; font-size:13px; line-height:1.5; color:#4d565b; }
.note-num { display:flex; align-items:center; justify-content:center; width:20px; height:20px; flex:none; border-radius:50%; background:var(--purple); color:#fff; font-size:11px; font-weight:800; }
.footer { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:2px 0 0; margin:0; overflow:hidden; }
.footer-text { font-size:15px; line-height:1.38; color:#555; }
.footer-text>div { margin:0; }
.footer-text>div:first-child { font-style:normal; }
.nar-logo-crop { width:220px; height:64px; max-width:26%; overflow:hidden; flex:0 0 auto; }
.nar-logo { display:block; width:220px; max-width:none; height:auto; margin:0; }
@media (hover:hover) and (pointer:fine) { .tap-hint.fancy:hover { transform:translateY(-1px); box-shadow:0 2px 4px #0000000f,0 8px 18px #0000001a; } }
@media (max-width:900px) {
 .container { padding:16px 20px 2px; }
 .chart-title { font-size:27px; }
 .subtitle { font-size:18px; line-height:1.52; margin:12px 0 18px; }
 .filter { font-size:12px; padding:8px 13px; }
 .footer-text { font-size:13px; }
 .nar-logo-crop { width:170px; height:50px; max-width:28%; }
 .nar-logo { width:170px; }
}
@media (max-width:768px) {
 .chart-title { font-size:21px; line-height:1.24; }
 .subtitle { font-size:15px; line-height:1.52; margin:12px 0 18px; }
 .chart-header { gap:12px; }
 .tap-hint.fancy { padding:6px 10px 6px 8px; gap:6px; }
 .tap-icon { font-size:16px; }
 .tap-text { font-size:9px; line-height:1.06; }
}
@media (max-width:600px) {
 .container { padding:16px 14px 1px; }
 .filters { gap:6px; margin-bottom:9px; padding-bottom:9px; }
 .filter { font-size:10px; padding:6px 10px; }
 .axis text { font-size:10px; }
 .end-label { font-size:9px; }
 .record-note { font-size:10.5px; padding:9px 10px; margin-bottom:18px; }
 .footer-text { font-size:10.5px; }
 .nar-logo-crop { width:110px; height:33px; max-width:34%; }
 .nar-logo { width:110px; }
}
@media (max-width:480px) {
 .chart-header { align-items:flex-start; gap:8px; }
 .chart-title { font-size:18px; line-height:1.22; letter-spacing:-.2px; }
 .subtitle { font-size:13.5px; line-height:1.5; margin:11px 0 16px; }
 .tap-hint.fancy { align-self:flex-start; margin-top:2px; padding:5px 7px 5px 6px; gap:4px; border-radius:7px; }
 .tap-icon { font-size:13px; }
 .tap-text { font-size:7px; line-height:1.02; }
 .desktop-text { display:none; }
 .mobile-text { display:block; }
}
@media (max-width:360px) { .chart-title { font-size:16px; } .subtitle { font-size:12.5px; line-height:1.48; } }


/* Chart-specific presentation: retains original stacked columns and interactions. */
.legend { display:flex; justify-content:flex-start; flex-wrap:wrap; gap:10px 22px; margin:0 0 16px; font-size:15px; font-weight:600; }
.legend-item { display:flex; align-items:center; gap:8px; cursor:pointer; border-radius:999px; padding:5px 8px; transition:background .18s; }
.legend-item:hover,.legend-item.active,.legend-item:focus-visible { background:#f3f5f6; }
.legend-item:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.swatch { width:16px; height:16px; flex:none; border-radius:3px; }
.segment { stroke:#fff; stroke-width:1.2; cursor:pointer; }
.bar-label { font-size:13px; font-weight:700; fill:#333; }
.inside-label { font-size:13px; font-weight:800; fill:#fff; pointer-events:none; }
.tip-value { font-size:20px; font-weight:800; }
.other-highlight { fill:none; stroke:#111; stroke-width:3; pointer-events:none; }
.other-callout { font-size:13px; fill:#333; font-weight:600; }
.other-callout-line { fill:none; stroke:#111; stroke-width:1.8; stroke-linecap:round; pointer-events:none; }
.other-marker { fill:#111; stroke:#fff; stroke-width:2; }
.other-marker-text { fill:#fff; font-size:11px; font-weight:800; pointer-events:none; }
.mobile-other-note { display:none; }
@media (max-width:1100px) and (min-width:601px) { .other-callout { font-size:11px; } .other-callout-line { stroke-width:1.6; } }
@media (max-width:900px) { .legend { font-size:13px; gap:8px 15px; } .swatch { width:14px; height:14px; } .bar-label { font-size:11px; } }
@media (max-width:600px) {
 .legend { font-size:10.5px; gap:6px 10px; margin-bottom:10px; }
 .legend-item { gap:5px; padding:3px 4px; }
 .swatch { width:11px; height:11px; }
 .bar-label,.inside-label { font-size:9px; }
 .mobile-other-note { display:grid; grid-template-columns:28px minmax(0,1fr); gap:8px; align-items:start; margin:10px 0 18px; }
 .mobile-other-note .num { display:flex; align-items:center; justify-content:center; width:25px; height:25px; border-radius:50%; background:#111; color:#fff; font-size:12px; font-weight:800; }
 .mobile-other-note p { margin:1px 0 0; font-size:10.5px; line-height:1.5; color:#444; font-weight:600; }
}

/* Shared typography values from the latest corrected reference. */
@media (min-width:901px) {
 .chart-title { font-size:29px; line-height:1.3; font-weight:700; letter-spacing:-.5px; }
 .subtitle { font-size:21px; line-height:1.55; margin:14px 0 24px; }
}
@media (min-width:769px) and (max-width:900px) {
 .chart-title { font-size:27px; line-height:1.3; font-weight:700; }
 .subtitle { font-size:18px; line-height:1.52; }
}
/* The source is a report title, not a Note. */
.footer-text > div:first-child { font-style:normal; }
/* Do not let global SVG line-chart rules interfere with stacked bars. */
#chart .segment { fill-opacity:1; }
@media (max-width:600px) {
 .tooltip { min-width:0; max-width:min(240px,90vw); font-size:11px; padding:8px 10px; }
 .tooltip strong { font-size:12px; }
 .tip-value { font-size:16px; }
}
