/* ──────────────────────────────────────────────────────────────
   App shell, loaded on every page after style.css / admin.css:
   bottom tab bar on phones, compact headers, and the Areas / Deals card layout.
   ────────────────────────────────────────────────────────────── */

.tabbar { display: none; }

/* Shared content pages (Areas, Deals, Research, Data) */
.page { max-width: 980px; margin: 60px auto 0; padding: 22px 16px 60px; }   /* 60px: the fixed .admin-header */
.page h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 4px 0 6px; line-height: 1.2; }
.page h2 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin: 30px 0 4px; }
.page .lead { color: rgba(13,27,42,.72); font-size: 15px; line-height: 1.6; margin: 0 0 14px; max-width: 760px; }
.page .hint { color: rgba(13,27,42,.62); font-size: 13px; margin: 0 0 12px; line-height: 1.5; }
.page .muted { color: rgba(13,27,42,.55); font-size: 12px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 16px; }
.chip { padding: 8px 14px; border: 1px solid var(--paper-line); background: #fff; color: var(--ink);
        text-decoration: none; font-size: 13px; border-radius: 999px; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { background: #fff; border: 1px solid var(--paper-line); padding: 16px; }
.card .place { font-family: var(--serif); font-size: 19px; line-height: 1.2; }
.card .sub { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: rgba(13,27,42,.55); margin-top: 3px; }
.card .nums { display: flex; gap: 16px; margin: 12px 0 8px; flex-wrap: wrap; }
.card .num b { display: block; font-size: 20px; font-weight: 600; line-height: 1.15; }
.card .num span { font-size: 11px; color: rgba(13,27,42,.6); }
.card p { font-size: 13px; line-height: 1.5; margin: 6px 0 0; color: rgba(13,27,42,.8); }
.badge { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
         padding: 3px 8px; margin-top: 8px; }
.b-strong { background: #d94e2f; color: #fff; } .b-prom { background: #e8954a; color: #fff; }
.b-ok { background: #c9a957; color: #0d1b2a; } .b-weak { background: #dcd6c8; color: #0d1b2a; }
.b-thin { border: 1px solid #ccc; color: #666; } .b-new { background: #0d1b2a; color: #fff; }

details.more { margin-top: 10px; border-top: 1px solid var(--paper-line); padding-top: 8px; }
details.more summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: ' ▾'; color: rgba(13,27,42,.5); }
details.more[open] summary::after { content: ' ▴'; }
.mini { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.mini td, .mini th { padding: 6px 4px; border-bottom: 1px solid var(--paper-line); text-align: left; vertical-align: top; }
.mini th { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: rgba(13,27,42,.55); font-weight: 400; }

.feed { display: flex; flex-direction: column; gap: 8px; }
.feed .item { background: #fff; border: 1px solid var(--paper-line); padding: 12px 14px; display: flex; gap: 14px; align-items: center; }
.feed .big { font-size: 20px; font-weight: 600; min-width: 74px; }
.feed .big small { display: block; font-size: 10px; font-weight: 400; color: rgba(13,27,42,.55); }
.feed .what { flex: 1; font-size: 14px; line-height: 1.4; }
.feed .what .muted { display: block; margin-top: 2px; }
.empty { background: #fff; border: 1px dashed var(--paper-line); padding: 14px; font-size: 13px; color: rgba(13,27,42,.65); }

/* ── Phones ───────────────────────────────────────────────── */
@media (max-width: 760px) {
    .tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000;
        background: var(--ink); border-top: 1px solid var(--ink-line);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px;
                color: rgba(244,237,226,.55); text-decoration: none; font-size: 10px; letter-spacing: .02em; }
    .tabbar a.on { color: var(--accent-gold); }
    .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

    /* top menus give way to the tab bar */
    .header-nav, .admin-nav, .header-stats, .site-footer { display: none !important; }
    body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }

    /* admin-style headers */
    .admin-header { padding: 0 14px !important; height: 54px !important; }
    .admin-header .admin-sub { display: none; }
    .admin-controls { flex-wrap: wrap; gap: 10px; padding: 10px 14px !important; }
    .page { margin-top: 54px; padding: 16px 12px 40px; }
    .page h1 { font-size: 25px; }
    .cards { grid-template-columns: 1fr; }
    .feed .item { padding: 11px 12px; gap: 10px; }
    .feed .big { font-size: 17px; min-width: 62px; }

    /* map page */
    :root { --header-h: 54px; }
    .site-header { padding: 0 14px; }
    .brand-mark { font-size: 26px; }
    .brand-name { font-size: 17px; }
    .brand-tag { display: none; }
    .app { bottom: calc(62px + env(safe-area-inset-bottom)) !important; }
    .sidebar { width: 100% !important; max-width: 420px; padding-bottom: 90px; }
    .legend { left: 10px; bottom: 10px; padding: 8px 10px; }
    .legend-scale { font-size: 10px; gap: 4px 6px; }
    .result-count { top: 10px; right: 10px; padding: 7px 10px; }
    .poly-stats, .trend-panel { left: 10px; right: 10px; top: 56px; width: auto !important; max-height: calc(100% - 70px); overflow-y: auto; }
    .detail-card { padding: 26px 18px; max-height: 85vh; overflow-y: auto; }
}

/* Map "Filters" button (phones): opens the sidebar; "Show results" closes it */
.filters-btn { display: none; }
.sidebar .sidebar-close { display: none; width: 100%; margin: 0 0 14px; padding: 10px; background: var(--ink); color: var(--paper);
                          border: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
@media (max-width: 900px) {
    .filters-btn {
        display: block; position: absolute; top: 10px; left: 10px; z-index: 550;
        background: var(--ink); color: var(--paper); border: 0; padding: 9px 14px;
        font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
        box-shadow: 0 4px 12px rgba(13,27,42,.2);
    }
    .sidebar .sidebar-close { display: block; }
}
