*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.65;
}

a { color: #0f3460; }
a:hover { color: #e94560; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1rem; }

/* ── Header ── */
.site-header {
    background: #16213e;
    color: white;
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-logo { font-size: 1.35rem; font-weight: 800; color: white; text-decoration: none; letter-spacing: -0.5px; }
.site-logo span { color: #4fc3f7; }
.site-nav a { color: rgba(255,255,255,0.8); text-decoration: none; margin-left: 1.5rem; font-size: 0.9rem; transition: color 0.15s; }
.site-nav a:hover { color: white; }

/* ── Main ── */
.main-content { padding: 2rem 0 3rem; }
.lead { font-size: 1.05rem; color: #555; margin-bottom: 1.5rem; }

/* ── Cards ── */
.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 5px rgba(0,0,0,0.07);
    margin-bottom: 1.5rem;
}

/* ── Stat hero ── */
.stat-hero {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 1.75rem;
}
.stat-value { font-size: 3.5rem; font-weight: 800; letter-spacing: -1.5px; line-height: 1; margin: 0.35rem 0; }
.stat-label { font-size: 0.95rem; opacity: 0.8; }
.stat-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.85rem;
}
.stat-badge.above { background: rgba(72,199,142,0.2); color: #48c78e; border: 1px solid rgba(72,199,142,0.4); }
.stat-badge.below { background: rgba(255,100,100,0.2); color: #ff7070; border: 1px solid rgba(255,100,100,0.4); }

/* ── Stats grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stat-item {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.07);
}
.stat-item-value { font-size: 1.9rem; font-weight: 800; color: #16213e; letter-spacing: -0.5px; }
.stat-item-label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 0.25rem; }

/* ── Breadcrumb ── */
.breadcrumb { font-size: 0.85rem; color: #999; margin-bottom: 1rem; }
.breadcrumb a { color: #0f3460; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.35rem; color: #ccc; }

/* ── Typography ── */
h1 { font-size: 2rem; font-weight: 800; color: #16213e; margin-bottom: 1rem; line-height: 1.2; }
h2 { font-size: 1.3rem; font-weight: 700; color: #16213e; margin-bottom: 0.7rem; margin-top: 0.25rem; }
h3 { font-size: 1rem; font-weight: 600; color: #333; margin-bottom: 0.5rem; margin-top: 1.25rem; }
p { margin-bottom: 1rem; color: #444; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
    text-align: left;
    padding: 0.7rem 1rem;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777;
}
.data-table td { padding: 0.7rem 1rem; border-bottom: 1px solid #f2f2f2; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }

/* ── Area grid (homepage) ── */
.area-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.6rem;
}
.area-link {
    display: block;
    padding: 0.7rem 1rem;
    background: white;
    border-radius: 7px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    text-decoration: none;
    color: #16213e;
    font-size: 0.88rem;
    font-weight: 500;
    transition: transform 0.12s, box-shadow 0.12s;
    border: 1px solid #eee;
}
.area-link:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); color: #0f3460; }
.area-link-stat { font-size: 0.78rem; color: #999; margin-top: 0.15rem; font-weight: 400; }

/* ── Ad units ── */
.ad-unit { margin: 1.75rem 0; text-align: center; }
.ad-unit-wide { min-height: 250px; }
.ad-placeholder {
    background: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    color: #bbb;
    font-size: 0.8rem;
}

/* ── Bar chart ── */
.bar-chart { margin: 0.75rem 0; }
.bar-item { display: flex; align-items: center; margin-bottom: 0.6rem; font-size: 0.88rem; }
.bar-name { width: 175px; flex-shrink: 0; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0.5rem; }
.bar-track { flex: 1; height: 22px; background: #f0f2f5; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #0f3460, #4fc3f7); border-radius: 4px; }
.bar-val { width: 75px; text-align: right; font-weight: 700; color: #16213e; font-size: 0.88rem; }

/* ── Related areas ── */
.related-areas { margin-top: 2rem; }
.related-areas h2 { margin-bottom: 0.75rem; }
.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 0.5rem;
}
.related-item {
    padding: 0.65rem 0.9rem;
    background: white;
    border-radius: 7px;
    border: 1px solid #eee;
    font-size: 0.85rem;
}
.related-item a { text-decoration: none; color: #0f3460; font-weight: 500; }
.related-item a:hover { text-decoration: underline; }
.related-stat { font-size: 0.75rem; color: #999; margin-top: 0.15rem; }

/* ── Colours ── */
.pos { color: #28a745; }
.neg { color: #dc3545; }
.neu { color: #6c757d; }

/* ── Footer ── */
.site-footer {
    background: #16213e;
    color: rgba(255,255,255,0.5);
    padding: 2rem 0;
    font-size: 0.82rem;
    line-height: 1.6;
}
.site-footer a { color: rgba(255,255,255,0.55); text-decoration: none; }
.site-footer a:hover { color: rgba(255,255,255,0.9); }
.footer-links { display: flex; gap: 1.5rem; margin-top: 0.6rem; flex-wrap: wrap; }

/* ── Responsive ── */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    .stat-value { font-size: 2.75rem; }
    .site-nav { display: none; }
    .bar-name { width: 105px; font-size: 0.78rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 2.25rem; }
}
