/* ============================================================
   Specrom Analytics — ALDI Store Locations Landing Page
   Design tokens aligned with style_main.css (DM Sans, blue primary)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Brand — matches style_main.css */
    --clr-primary:       #1a56db;
    --clr-primary-dark:  #1244b0;
    --clr-primary-light: #e8effc;
    --clr-accent:        #f59e0b;

    /* Neutrals */
    --clr-bg:            #ffffff;
    --clr-surface:       #f8fafc;
    --clr-surface-alt:   #f1f5f9;
    --clr-border:        #e2e8f0;
    --clr-border-light:  #f1f5f9;
    --clr-text:          #1e293b;
    --clr-text-secondary:#475569;
    --clr-text-muted:    #94a3b8;

    /* Feedback */
    --clr-success:       #16a34a;

    /* Typography — matches style_main.css */
    --font-heading: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --font-body:    'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --font-mono:    'DM Mono', 'Fira Code', monospace;

    /* Spacing (4px base) */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
    --sp-12: 48px;

    /* Radii & Shadows */
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 14px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.10);

    --container: 960px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.65;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--clr-primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--clr-primary-dark); }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    border-bottom: 1px solid var(--clr-border);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.logo-link { display: flex; align-items: center; }
.logo-img  { height: 28px; width: auto; }

.header-nav { display: flex; gap: 24px; }
.header-nav a {
    font-size: 13px;
    font-weight: 500;
    color: var(--clr-text-secondary);
    letter-spacing: .01em;
}
.header-nav a:hover { color: var(--clr-text); text-decoration: none; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-bar {
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border-light);
    padding: 10px 0;
    font-size: 12px;
}
.breadcrumb-bar a { color: var(--clr-text-muted); }
.breadcrumb-bar a:hover { color: var(--clr-primary); }
.breadcrumb-bar .sep     { color: var(--clr-border); margin: 0 6px; }
.breadcrumb-bar .current { color: var(--clr-text-secondary); font-weight: 500; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    padding: 52px 0 60px;
    background:
        radial-gradient(ellipse 80% 60% at 0% 0%, rgba(26,86,219,.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 100% 100%, rgba(26,86,219,.04) 0%, transparent 50%),
        var(--clr-bg);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    align-items: start;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--clr-primary-light);
    color: var(--clr-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
    font-family: var(--font-mono);
}

.badge-dot {
    width: 7px; height: 7px;
    background: var(--clr-primary);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.03em;
    color: var(--clr-text);
    margin-bottom: 16px;
}
.hero h1 .accent { color: var(--clr-primary); }

.hero-desc {
    font-size: 16px;
    color: var(--clr-text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 520px;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
}
.stat-item { text-align: center; }
.stat-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--clr-text);
    line-height: 1;
    letter-spacing: -.02em;
}
.stat-label {
    display: block;
    font-size: 11px;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 4px;
    font-weight: 500;
}
.stat-divider { width: 1px; height: 36px; background: var(--clr-border); }

/* Hero CTA */
.hero-cta { display: flex; flex-direction: column; gap: 12px; }

.price-block {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}
.price-old {
    font-size: 16px;
    color: var(--clr-text-muted);
    text-decoration: line-through;
    font-weight: 500;
}
.price-now {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: var(--clr-primary);
    letter-spacing: -.02em;
}
.price-format {
    font-size: 13px;
    color: var(--clr-text-muted);
    font-weight: 500;
}

.btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--clr-primary);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(26,86,219,.2), 0 4px 12px rgba(26,86,219,.15);
}
.btn-buy:hover {
    background: var(--clr-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(26,86,219,.25), 0 8px 20px rgba(26,86,219,.18);
    text-decoration: none;
    color: #fff;
}
.btn-buy:active { transform: translateY(0); }
.btn-buy-lg { font-size: 17px; padding: 16px 40px; }

.cta-note { font-size: 12px; color: var(--clr-text-muted); }

/* Hero Visual — data card */
.hero-visual { padding-top: 8px; }

.data-card-preview {
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.card-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--clr-border-light);
}

.brand-logo {
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--clr-border-light);
}
.card-brand {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--clr-text);
}
.card-cat {
    display: block;
    font-size: 12px;
    color: var(--clr-text-muted);
    margin-top: 1px;
}

.card-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }

.field-tag {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
}

.card-row-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--clr-text-secondary);
    font-weight: 500;
    padding-top: 16px;
    border-top: 1px solid var(--clr-border-light);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 56px 0; }
.section-alt { background: var(--clr-surface); }

.section h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--clr-text);
    margin-bottom: 12px;
    line-height: 1.2;
}

.section-lead {
    font-size: 15px;
    color: var(--clr-text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 700px;
}

.section p {
    color: var(--clr-text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
    max-width: 750px;
}

/* ============================================================
   MAP
   ============================================================ */
.map-container {
    margin-top: 32px;
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.map-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--clr-border-light);
}
.map-title-row h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--clr-text);
    margin: 0;
}

.map-legend { display: flex; gap: 12px; flex-wrap: wrap; }

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--clr-text-muted);
    font-weight: 500;
}

.legend-swatch {
    width: 14px; height: 14px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid rgba(0,0,0,.08);
}

.map-svg-wrap { padding: 24px 20px; }
.map-svg-wrap svg { width: 100%; height: auto; }

.map-svg-wrap .state-path {
    transition: opacity .15s;
    cursor: default;
}
.map-svg-wrap .state-path:hover { opacity: .8; }
.map-svg-wrap .state-path.inactive { fill: #f1f5f9; stroke: #e2e8f0; }

/* ============================================================
   STATE TABLE
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    background: var(--clr-bg);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--clr-text-muted);
    border-bottom: 2px solid var(--clr-border);
    font-family: var(--font-mono);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
thead th:hover { color: var(--clr-text-secondary); }
thead th.num    { text-align: right; }
thead th.bar-col { cursor: default; min-width: 160px; }

thead th.sorted-asc::after,
thead th.sorted-desc::after {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}
thead th.sorted-asc::after  { border-bottom: 5px solid var(--clr-primary); }
thead th.sorted-desc::after { border-top:    5px solid var(--clr-primary); }

tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--clr-border-light);
    color: var(--clr-text);
}
tbody td.num { text-align: right; font-family: var(--font-mono); font-weight: 500; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(26,86,219,.03); }

.bar-cell { display: flex; align-items: center; }
.bar-track {
    flex: 1;
    height: 8px;
    background: var(--clr-surface);
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #93c5fd, #1d4ed8);
    border-radius: 4px;
    transition: width .4s ease;
}

/* ============================================================
   SAMPLE TABLE
   ============================================================ */
.sample-table-wrap { margin-bottom: 28px; }
.sample-table thead th { cursor: default; }
.sample-table td.mono  { font-family: var(--font-mono); font-size: 13px; color: var(--clr-text-secondary); }
.sample-table td strong { color: var(--clr-primary); font-family: var(--font-mono); font-weight: 600; }

/* Fields block */
.fields-block {
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 24px;
}
.fields-block h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--clr-text);
}
.fields-list  { display: flex; flex-wrap: wrap; gap: 8px; }
.field-chip {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    color: var(--clr-text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 5px;
}

/* ============================================================
   CITIES GRID
   ============================================================ */
.cities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.city-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    transition: border-color .2s;
}
.city-card:hover { border-color: var(--clr-primary); }

.city-card.city-top {
    background: var(--clr-primary-light);
    border-color: rgba(26,86,219,.2);
}

.city-rank {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--clr-text-muted);
    min-width: 24px;
}
.city-top .city-rank { color: var(--clr-primary); }

.city-name { flex: 1; font-weight: 600; font-size: 14px; color: var(--clr-text); }

.city-count {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--clr-text);
}
.city-top .city-count { color: var(--clr-primary-dark); }

/* ============================================================
   USE CASES
   ============================================================ */
.usecase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.usecase-card {
    padding: 28px 24px;
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    transition: border-color .2s, box-shadow .2s;
}
.usecase-card:hover {
    border-color: var(--clr-primary);
    box-shadow: 0 2px 12px rgba(26,86,219,.07);
}
.usecase-icon {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 16px;
    color: var(--clr-primary);
}
.icon-bg-1 { background: #ede9fe; color: #7c3aed !important; }
.icon-bg-2 { background: #dbeafe; color: var(--clr-primary) !important; }
.icon-bg-3 { background: #dcfce7; color: #16a34a !important; }
.icon-bg-4 { background: #fef9c3; color: #ca8a04 !important; }

.usecase-card h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--clr-text);
}
.usecase-card p {
    font-size: 14px;
    color: var(--clr-text-secondary);
    line-height: 1.6;
    margin: 0;
    max-width: none;
}

/* ============================================================
   BUY / CTA SECTION
   ============================================================ */
.section-buy {
    background:
        linear-gradient(135deg, var(--clr-primary-light) 0%, #fff 40%, var(--clr-primary-light) 100%);
    border-top: 1px solid var(--clr-border);
    border-bottom: 1px solid var(--clr-border);
}

.buy-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: center;
}
.buy-card h2     { margin-bottom: 8px; }
.buy-card > .buy-info > p { color: var(--clr-text-secondary); margin-bottom: 20px; }

.buy-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.buy-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--clr-text);
    font-weight: 500;
}

.buy-action {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.buy-price-block { display: flex; align-items: baseline; gap: 10px; }
.buy-old {
    font-size: 18px;
    color: var(--clr-text-muted);
    text-decoration: line-through;
}
.buy-now {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 800;
    color: var(--clr-primary);
    letter-spacing: -.03em;
    line-height: 1;
}

.buy-secure {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--clr-text-muted);
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.faq-item {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    background: var(--clr-bg);
    overflow: hidden;
    transition: box-shadow .2s;
}
.faq-item[open] { box-shadow: var(--shadow-sm); }

.faq-item summary {
    padding: 16px 20px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--clr-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    color: var(--clr-text-muted);
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: 16px;
}
.faq-item[open] summary::after { content: '−'; color: var(--clr-primary); }

.faq-body { padding: 0 20px 16px; }
.faq-body p {
    font-size: 14px;
    color: var(--clr-text-secondary);
    line-height: 1.7;
    margin: 0;
    max-width: none;
}

/* ============================================================
   BOTTOM CTA
   ============================================================ */
.section-bottom-cta { text-align: center; padding: 56px 0; }
.section-bottom-cta h2 { margin-bottom: 8px; }
.section-bottom-cta p {
    color: var(--clr-text-secondary);
    margin: 0 auto 24px;
    font-size: 15px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--clr-surface);
    border-top: 1px solid var(--clr-border);
    padding: 40px 0 24px;
    font-size: 13px;
    color: var(--clr-text-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.footer-grid strong {
    font-family: var(--font-heading);
    font-size: 15px;
    color: var(--clr-text);
    display: block;
    margin-bottom: 6px;
}
.footer-grid p    { margin: 0; max-width: none; }
.footer-grid h4   {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--clr-text-muted);
    margin-bottom: 12px;
}
.footer-grid div:nth-child(2),
.footer-grid div:nth-child(3) { display: flex; flex-direction: column; gap: 8px; }
.footer-grid a { color: var(--clr-text-secondary); font-size: 13px; }
.footer-grid a:hover { color: var(--clr-primary); }

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--clr-border);
    font-size: 12px;
    color: var(--clr-text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hero-grid          { grid-template-columns: 1fr; gap: 32px; }
    .hero h1            { font-size: 30px; }
    .hero-stats         { gap: 16px; padding: 16px; }
    .stat-num           { font-size: 22px; }
    .hero-visual        { order: -1; }
    .cities-grid        { grid-template-columns: 1fr 1fr; }
    .usecase-grid       { grid-template-columns: 1fr; }
    .buy-card           { grid-template-columns: 1fr; gap: 28px; text-align: center; }
    .buy-features       { align-items: center; }
    .footer-grid        { grid-template-columns: 1fr; gap: 24px; }
    .map-title-row      { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .hero            { padding: 32px 0 40px; }
    .hero h1         { font-size: 26px; }
    .hero-stats      { flex-direction: column; gap: 12px; }
    .stat-divider    { width: 40px; height: 1px; }
    .cities-grid     { grid-template-columns: 1fr; }
    .price-now       { font-size: 28px; }
    .buy-now         { font-size: 36px; }
    .map-legend      { gap: 8px; }
    .legend-item     { font-size: 10px; }
}

/* ============================================================
   INSIGHTS ARTICLE — additive components
   (Publix vs. Competitors: Google Maps Data Analysis)
   Reuses the design tokens, header, breadcrumb, hero, section,
   table, and FAQ rules defined above. Everything below is new.
   ============================================================ */

/* ---- Reading progress bar ---- */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--clr-primary), #60a5fa);
    z-index: 200;
    transition: width .1s linear;
}

/* ---- Article meta row (byline / date / category) ---- */
.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--clr-text-muted);
    font-family: var(--font-mono);
    margin-bottom: 18px;
}
.article-meta .meta-dot { color: var(--clr-border); }
.article-meta strong { color: var(--clr-text-secondary); font-weight: 600; }

/* ---- Hero lede (italic dek under h1, used inside hero-desc slot) ---- */
.hero-desc em, .lede { font-style: italic; }

/* ---- Hero visual: chart preview card ---- */
.card-chart-thumb {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--clr-border-light);
    margin-top: 2px;
}
.card-chart-caption {
    display: block;
    font-size: 11px;
    color: var(--clr-text-muted);
    margin-top: 10px;
    line-height: 1.5;
}

/* ---- Table of contents ---- */
.toc-card {
    margin-top: -8px;
    margin-bottom: 8px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.toc-card h2 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--clr-text-muted);
    margin-bottom: 14px;
}
.toc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 20px;
}
.toc-grid a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--clr-text);
    padding: 4px 0;
}
.toc-grid a:hover { color: var(--clr-primary); text-decoration: none; }
.toc-grid a::before {
    content: '→';
    color: var(--clr-primary);
    font-size: 12px;
    flex-shrink: 0;
}

/* Anchor offset so sticky header doesn't cover section headings */
.section[id], h2[id] { scroll-margin-top: 72px; }

/* ---- Chart figures ---- */
.chart-figure {
    margin: 28px 0;
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow-sm);
}
.chart-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: calc(var(--radius) - 4px);
}
.chart-figure figcaption {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--clr-text-muted);
    padding: 12px 14px 8px;
    font-family: var(--font-mono);
}
.chart-figure figcaption svg { flex-shrink: 0; color: var(--clr-text-muted); }

/* ---- Two-up layout (chart + supporting stats) ---- */
.split-row {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 28px;
    align-items: center;
    margin: 24px 0;
}
.split-row .chart-figure { margin: 0; }

/* ---- Key-finding callout ---- */
.callout {
    display: flex;
    gap: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid var(--clr-accent);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 20px 0;
}
.callout-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    color: var(--clr-accent);
    margin-top: 1px;
}
.callout p {
    margin: 0;
    font-size: 14px;
    color: #78350f;
    line-height: 1.65;
    max-width: none;
}
.callout p strong { color: #78350f; }
.callout.callout-blue {
    background: var(--clr-primary-light);
    border-color: #bfdbfe;
    border-left-color: var(--clr-primary);
}
.callout.callout-blue p { color: var(--clr-text); }
.callout.callout-blue .callout-icon { color: var(--clr-primary); }

/* ---- Big stat trio (e.g. pharmacy rating gap) ---- */
.stat-trio {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.stat-trio-item {
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.stat-trio-num {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--clr-primary);
    line-height: 1;
    display: block;
}
.stat-trio-label {
    font-size: 12.5px;
    color: var(--clr-text-secondary);
    margin-top: 6px;
    display: block;
    line-height: 1.5;
}

/* ---- Inline mid-article CTA ---- */
.inline-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--clr-surface);
    border: 1px dashed var(--clr-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 32px 0 8px;
}
.inline-cta-text strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 15px;
    color: var(--clr-text);
    margin-bottom: 2px;
}
.inline-cta-text span {
    font-size: 13px;
    color: var(--clr-text-secondary);
}
.btn-buy-sm {
    padding: 10px 20px;
    font-size: 13px;
    flex-shrink: 0;
}

/* ---- Attribute stat tiles ---- */
.attr-group { margin-bottom: 28px; }
.attr-group:last-child { margin-bottom: 0; }
.attr-group-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--clr-text-muted);
    margin-bottom: 12px;
}
.attr-tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.attr-tile {
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: left;
}
.attr-tile-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--clr-primary);
    letter-spacing: -.02em;
    line-height: 1;
}
.attr-tile-label {
    display: block;
    font-size: 12px;
    color: var(--clr-text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}
.attr-tile.attr-null { background: var(--clr-surface); }
.attr-tile.attr-null .attr-tile-value { color: var(--clr-text-muted); }

/* ---- Leaderboard tables (highest / lowest rated stores) ---- */
.leaderboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}
.leaderboard-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--clr-text);
    margin-bottom: 10px;
}
.leaderboard-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.leaderboard-title.title-high .leaderboard-dot { background: var(--clr-success); }
.leaderboard-title.title-low  .leaderboard-dot { background: var(--clr-text-muted); }
.leaderboard-grid table td.mono { font-family: var(--font-mono); font-size: 13px; }
.leaderboard-grid table td strong { color: var(--clr-primary); font-weight: 700; }

/* ---- Disclosure / limitation box ---- */
.disclosure-box {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 13.5px;
    color: var(--clr-text-secondary);
    line-height: 1.65;
}
.disclosure-box strong { color: var(--clr-text); }

/* ---- Methodology (collapsible) ---- */
.methodology-details {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    background: var(--clr-bg);
    overflow: hidden;
}
.methodology-details summary {
    padding: 18px 24px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--clr-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.methodology-details summary::-webkit-details-marker { display: none; }
.methodology-details summary::after {
    content: '+';
    margin-left: auto;
    font-size: 20px;
    color: var(--clr-text-muted);
}
.methodology-details[open] summary::after { content: '−'; color: var(--clr-primary); }
.methodology-details summary svg { color: var(--clr-primary); flex-shrink: 0; }
.methodology-body {
    padding: 4px 24px 24px;
    border-top: 1px solid var(--clr-border-light);
}
.methodology-body p {
    font-size: 13.5px;
    line-height: 1.75;
}
.methodology-body p:first-child { padding-top: 18px; }

/* ---- Footnote-style source line under charts/sections ---- */
.source-note {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--clr-text-muted);
    margin-top: -8px;
    margin-bottom: 20px;
}

/* ---- Back to top ---- */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--clr-bg);
    border: 1px solid var(--clr-border);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clr-text-secondary);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, border-color .2s, color .2s;
    z-index: 90;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { border-color: var(--clr-primary); color: var(--clr-primary); }

/* ---- Section eyebrow (small mono label above h2) ---- */
.section-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--clr-primary);
    margin-bottom: 10px;
}

/* ---- Pull quote (single standout line, e.g. pharmacy finding) ---- */
.pull-quote {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--clr-text);
    letter-spacing: -.01em;
    margin: 4px 0 20px;
    max-width: 700px;
}

/* ============================================================
   RESPONSIVE — insights article additions
   ============================================================ */
@media (max-width: 768px) {
    .toc-grid            { grid-template-columns: 1fr 1fr; }
    .split-row            { grid-template-columns: 1fr; gap: 16px; }
    .attr-tile-grid        { grid-template-columns: repeat(2, 1fr); }
    .leaderboard-grid      { grid-template-columns: 1fr; }
    .inline-cta            { flex-direction: column; align-items: flex-start; }
    .pull-quote            { font-size: 17px; }
}

@media (max-width: 480px) {
    .toc-grid       { grid-template-columns: 1fr; }
    .attr-tile-grid  { grid-template-columns: 1fr 1fr; }
    .stat-trio-num   { font-size: 26px; }
    .back-to-top     { width: 38px; height: 38px; right: 14px; bottom: 14px; }
}

/* ============================================================
   JS-RENDERED CHARTS (Michaels article — client-side SVG charts
   built from the pipeline's own exported data; see README.md)
   ============================================================ */
:root {
    --clr-danger: #ef4444;
    --clr-purple: #7c3aed;
}

/* ---- Chart figure variant for JS/SVG charts (more inner breathing room
        than the plain <img> chart-figure above) ---- */
.chart-figure.chart-js { padding: 20px 20px 6px; }
.chart-figure.chart-js .chart-figure-title {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--clr-text);
    margin-bottom: 4px;
}
.chart-figure.chart-js figcaption { padding: 10px 2px 4px; }

.chart-canvas { width: 100%; overflow: hidden; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg text { font-family: var(--font-body); }

/* generic svg text styles shared across chart types */
.axis-text        { fill: var(--clr-text-muted); font-size: 11.5px; }
.axis-sub          { fill: var(--clr-text-muted); font-size: 10.5px; }
.axis-title-sm     { fill: var(--clr-text-muted); font-size: 11px; font-family: var(--font-mono); }
.axis-line         { stroke: var(--clr-border); stroke-width: 1; }
.grid-line         { stroke: var(--clr-border-light); stroke-width: 1; }
.value-text        { fill: var(--clr-text); font-size: 12.5px; font-weight: 700; font-family: var(--font-heading); }
.value-text-sm     { fill: var(--clr-text-secondary); font-size: 10.5px; font-weight: 700; font-family: var(--font-heading); }
.hbar-label        { fill: var(--clr-text); font-size: 12.5px; font-weight: 600; }
.hbar-sub          { fill: var(--clr-text-muted); font-size: 10.5px; font-family: var(--font-mono); }
.hbar-value        { fill: var(--clr-text); font-size: 12px; font-weight: 700; font-family: var(--font-heading); }
.hbar-track        { fill: var(--clr-surface); }
.donut-center-value{ fill: var(--clr-text); font-size: 30px; font-weight: 800; font-family: var(--font-heading); letter-spacing: -.02em; }
.donut-center-sub  { fill: var(--clr-text-muted); font-size: 12px; font-weight: 500; }

/* box plot */
.box-whisker  { stroke: var(--clr-text-muted); stroke-width: 2; }
.box-rect     { fill: var(--clr-primary-light); fill-opacity: .35; stroke: var(--clr-primary); stroke-width: 1.5; }
.box-median   { stroke: var(--clr-primary-dark); stroke-width: 2.5; }
.box-maxline  { stroke: var(--clr-text-muted); stroke-width: 1; stroke-dasharray: 3,3; }
.box-maxdot   { fill: var(--clr-bg); stroke: var(--clr-text-muted); stroke-width: 1.5; }

/* ---- Donut legend (reuses .legend-item / .legend-swatch from MAP section) ---- */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    justify-content: center;
    margin-top: 6px;
    padding-top: 4px;
}
.chart-legend .legend-item { font-size: 12.5px; color: var(--clr-text-secondary); }
.chart-legend .legend-item strong { color: var(--clr-text); }

/* ---- Two-up chart grid (donut + leaderboard, or two scatter panels) ---- */
.chart-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
.chart-grid-2 .chart-figure { margin: 0; }

/* ---- Segmented proportion bar (own-brand rating gap) ---- */
.segmented-bar {
    display: flex;
    height: 18px;
    border-radius: 9px;
    overflow: hidden;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    margin: 4px 0 12px;
}
.segmented-bar span { display: block; height: 100%; }
.segmented-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12.5px;
    color: var(--clr-text-secondary);
    margin-bottom: 4px;
}
.segmented-legend .dot-danger, .segmented-legend .dot-muted, .segmented-legend .dot-success {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px;
}
.segmented-legend .dot-danger  { background: var(--clr-danger); }
.segmented-legend .dot-muted   { background: var(--clr-border); }
.segmented-legend .dot-success { background: var(--clr-success); }

/* ---- Chain-scope big-stat + bar hybrid ---- */
.scope-hero {
    display: flex;
    align-items: baseline;
    gap: 14px;
    background: var(--clr-primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.scope-hero-num {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 800;
    color: var(--clr-primary-dark);
    letter-spacing: -.02em;
    line-height: 1;
}
.scope-hero-text { font-size: 13.5px; color: var(--clr-text); line-height: 1.5; max-width: 420px; }
.scope-hero-text strong { display: block; font-size: 14.5px; margin-bottom: 2px; }

/* ---- Sortable state table extras ---- */
.bcell-val {
    width: 54px;
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--clr-text);
    margin-right: 8px;
    text-align: right;
}
tbody tr.thin-sample td { color: var(--clr-text-muted); }
.thin-flag { color: var(--clr-primary); cursor: help; }
td.mono { font-family: var(--font-mono); }

/* ---- Chart-caveat note (photo cap, tenure proxy, etc.) ---- */
.chart-caveat {
    display: flex;
    gap: 10px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--clr-text-secondary);
    line-height: 1.6;
}
.chart-caveat svg { flex-shrink: 0; color: var(--clr-text-muted); margin-top: 1px; }
.chart-caveat strong { color: var(--clr-text); }

/* ---- README pointer box (moved-methodology notice) ---- */
.readme-pointer {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--clr-bg);
    border: 1px dashed var(--clr-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 18px;
}
.readme-pointer svg { flex-shrink: 0; color: var(--clr-primary); }
.readme-pointer span { font-size: 13px; color: var(--clr-text-secondary); }
.readme-pointer a { font-weight: 600; }

@media (max-width: 768px) {
    .chart-grid-2 { grid-template-columns: 1fr; }
    .scope-hero { flex-direction: column; align-items: flex-start; gap: 4px; }
    .scope-hero-num { font-size: 32px; }
}

