/* /analytics/ : the site-data dashboard. Colors and radii come from main.css. */

.an-main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 60px; }
.an-main h1 { margin: 0 0 4px; }
.an-intro { margin: 0 0 4px; color: var(--muted); max-width: 760px; }
.an-asof { margin: 0 0 14px; color: var(--muted); font-size: 0.9rem; }
.an-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.an-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.an-tab { font: inherit; font-weight: 600; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 10px 14px; cursor: pointer; min-height: 44px; }
.an-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.an-tab:hover { color: var(--ink); }
.an-panel[hidden] { display: none; }

.an-grid { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.an-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; grid-column: span 12; min-width: 0; }
.an-c8 { grid-column: span 8; }
.an-c6 { grid-column: span 6; }
.an-c4 { grid-column: span 4; }
.an-c3 { grid-column: span 3; }
@media (max-width: 860px) {
    .an-c8, .an-c6, .an-c4 { grid-column: span 12; }
    .an-c3 { grid-column: span 6; }
}
.an-card h2 { margin: 0; font-size: 1.05rem; font-weight: 650; text-align: left; }
.an-sub { margin: 2px 0 12px; color: var(--muted); font-size: 0.875rem; }
.an-note { margin: 8px 0 0; color: var(--muted); font-size: 0.83rem; }
.an-sec { grid-column: span 12; margin: 8px 0 -2px; font-size: 1rem; font-weight: 650; text-align: left; }
.an-sec span { margin-left: 8px; font-weight: 400; font-size: 0.875rem; color: var(--muted); }
.an-since { grid-column: span 12; background: var(--brand-tint); border: 1px solid var(--brand-line); border-radius: var(--r-sm); padding: 9px 12px; font-size: 0.875rem; }

.an-kpi-label { color: var(--muted); font-size: 0.875rem; }
.an-kpi-value { font-size: 1.9rem; font-weight: 650; line-height: 1.15; margin-top: 2px; }
.an-kpi-delta { color: var(--muted); font-size: 0.83rem; margin-top: 2px; min-height: 1.2em; }
.an-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 10px; }
.an-stats b { display: block; font-size: 1.4rem; font-weight: 650; line-height: 1.2; }
.an-stats span { color: var(--muted); font-size: 0.83rem; }

.an-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; font-size: 0.83rem; color: var(--muted); }
.an-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.an-legend b { color: var(--ink); font-weight: 600; }
.an-legend-col { flex-direction: column; gap: 5px; }

.an-card svg { display: block; width: 100%; height: auto; overflow: visible; }
.an-card svg text { font-family: var(--font); font-size: 12px; fill: var(--muted); }
.an-card svg text.an-strong { fill: var(--ink); font-weight: 600; }
.an-link { opacity: 0.38; }
.an-link:hover { opacity: 0.62; }
.an-click { cursor: pointer; }

.an-seg { display: flex; gap: 2px; height: 34px; margin: 4px 0 8px; }
.an-seg div { border-radius: 4px; min-width: 2px; color: var(--surface); font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; justify-content: center; white-space: nowrap; }

.an-rank { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 6px 10px; align-items: center; font-size: 0.9rem; }
.an-bar { height: 10px; background: var(--well); border-radius: 4px; }
.an-bar b { display: block; height: 10px; min-width: 2px; border-radius: 4px; background: var(--highlight); }
.an-fig { color: var(--muted); font-size: 0.83rem; white-space: nowrap; text-align: right; }

.an-scroll { overflow-x: auto; }
.an-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.an-table th, .an-table td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.an-table th:first-child, .an-table td:first-child { text-align: left; white-space: normal; }
.an-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.an-table th button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.an-table th button:hover { color: var(--ink); }
.an-group td { background: var(--well); font-weight: 650; font-size: 0.8rem; color: var(--muted); padding: 5px 10px; }
.an-row { cursor: pointer; }
.an-row:hover td { background: var(--brand-tint); }
.an-meter { display: inline-block; width: 70px; height: 6px; margin-right: 8px; background: var(--well); border-radius: 3px; vertical-align: middle; }
.an-meter b { display: block; height: 6px; border-radius: 3px; background: var(--highlight); }
.an-card svg.an-spark { width: 110px; height: 22px; display: inline-block; }
.an-mini th, .an-mini td { padding: 5px 8px; font-size: 0.875rem; }
.an-mini h3 { margin: 10px 0 4px; font-size: 0.875rem; }
.an-tbl { margin-top: 8px; font-size: 0.875rem; }
.an-tbl summary { color: var(--link); cursor: pointer; }

.an-picker { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.an-picker select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); max-width: 100%; min-height: 44px; }

.an-kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 0.9rem; }
.an-kv .an-n { font-weight: 650; text-align: right; }
.an-kv .an-m { grid-column: 1 / -1; margin-top: -5px; color: var(--muted); font-size: 0.8rem; }
.an-chg { display: grid; grid-template-columns: 62px 1fr; gap: 8px 12px; font-size: 0.875rem; max-height: 330px; overflow-y: auto; }
.an-chg .an-d { color: var(--muted); white-space: nowrap; }
.an-chg .an-k { font-weight: 650; }
.an-pill { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: var(--r-pill); font-size: 0.72rem; font-weight: 650; }
.an-pill-fix { background: var(--bad-tint); color: var(--bad); }
.an-pill-change { background: var(--brand-tint); color: var(--brand); }

.an-methods { margin: 10px 0 0; padding-left: 20px; }
.an-methods li { margin-bottom: 8px; }

.an-tip { position: fixed; z-index: 30; pointer-events: none; max-width: 300px; padding: 7px 10px; border-radius: var(--r-sm); background: var(--ink); color: var(--surface); font-size: 0.8rem; line-height: 1.4; }
.an-tip[hidden] { display: none; }
.an-tip .an-m { opacity: 0.75; }
