:root {
    --analytics-purple: #6956c8;
    --analytics-purple-soft: #eeeaff;
    --analytics-green: #27856d;
}

.analytics-site {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 2%, rgba(255, 179, 127, .18), transparent 27rem),
        radial-gradient(circle at 92% 13%, rgba(105, 86, 200, .12), transparent 25rem),
        var(--canvas, #fbf8f3);
}

.analytics-main {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.analytics-main {
    padding: 46px 0 70px;
}

.analytics-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 28px;
}

.analytics-hero > div { max-width: 720px; }
.analytics-hero .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--analytics-green); }
.analytics-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #37a783; box-shadow: 0 0 0 5px rgba(55, 167, 131, .12); }
.analytics-hero h1 { margin: 8px 0 10px; color: var(--ink); font: 850 clamp(34px, 5vw, 58px)/1.03 var(--display); letter-spacing: -.045em; }
.analytics-hero > div > p:last-child { max-width: 660px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.analytics-hero aside { min-width: 210px; padding: 15px 18px; border: 1px solid #bbdcd0; border-radius: 16px; background: rgba(240, 251, 247, .83); color: #286a58; }
.analytics-hero aside strong, .analytics-hero aside span { display: block; }
.analytics-hero aside strong { font-size: 14px; }
.analytics-hero aside span { margin-top: 2px; font-size: 12px; }

.analytics-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: end;
    gap: 16px;
    padding: 16px;
    border-radius: 20px;
}

.analytics-toolbar label > span,
.analytics-range-picker legend { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.analytics-toolbar select,
.analytics-toolbar input,
.analytics-range-picker button,
.analytics-custom-dates button,
.analytics-export {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface, #fffdfa);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 750;
}
.analytics-toolbar select { width: 100%; padding: 0 36px 0 12px; }
.analytics-range-picker { display: flex; gap: 5px; min-width: 0; padding: 0; border: 0; }
.analytics-range-picker legend { float: left; width: 100%; }
.analytics-range-picker button { padding: 0 12px; cursor: pointer; }
.analytics-range-picker button:hover,
.analytics-range-picker button:focus-visible,
.analytics-range-picker button.is-active { border-color: #9b8fe0; background: var(--analytics-purple-soft); color: #493995; }
.analytics-export { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; text-decoration: none; }
.analytics-export:hover, .analytics-export:focus-visible { border-color: #d17b66; color: var(--accent-ink); }
.analytics-custom-dates { grid-column: 1 / -1; display: flex; align-items: end; gap: 10px; padding-top: 4px; }
.analytics-custom-dates[hidden] { display: none; }
.analytics-custom-dates label { width: min(190px, 40%); }
.analytics-custom-dates input { width: 100%; padding: 0 10px; }
.analytics-custom-dates button { padding-inline: 18px; cursor: pointer; }

.analytics-filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.analytics-filter-bar[hidden] { display: none; }
.analytics-filter-bar > div { display: flex; flex-wrap: wrap; gap: 6px; }
.analytics-filter-bar button { padding: 6px 9px; border: 1px solid #c8bdf1; border-radius: 999px; background: #f3f0ff; color: #4d3d98; font: inherit; font-weight: 750; cursor: pointer; }
#analytics-clear-filters { border: 0; background: transparent; color: var(--accent-ink); text-decoration: underline; }

.analytics-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.analytics-summary article { position: relative; min-height: 140px; padding: 20px; overflow: hidden; border-radius: 19px; }
.analytics-summary article::after { content: ''; position: absolute; width: 90px; height: 90px; right: -28px; bottom: -36px; border-radius: 50%; background: var(--analytics-purple-soft); }
.analytics-summary article:nth-child(2)::after { background: #fff0df; }
.analytics-summary article:nth-child(3)::after { background: #e6f6ef; }
.analytics-summary span, .analytics-summary strong, .analytics-summary small { position: relative; z-index: 1; display: block; }
.analytics-summary span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .035em; }
.analytics-summary strong { margin: 9px 0 5px; color: var(--ink); font: 850 34px/1 var(--display); }
.analytics-summary small { color: var(--muted); font-size: 11px; }
.analytics-summary small.is-up { color: #23755f; }
.analytics-summary small.is-down { color: #a94b41; }

.analytics-status { min-height: 20px; margin: 0 0 9px; color: var(--muted); font-size: 12px; }
.analytics-status.is-error { color: #a43f38; }
.analytics-gap-warning { display: flex; gap: 8px; margin-bottom: 14px; padding: 11px 14px; border: 1px solid #e7c475; border-radius: 12px; background: #fff8df; color: #6d5820; font-size: 12px; }
.analytics-gap-warning[hidden] { display: none; }

.analytics-chart-card { padding: 22px; border-radius: 22px; }
.analytics-chart-card > header,
.analytics-list-card > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.analytics-chart-card h2,
.analytics-list-card h2,
.analytics-notes h2 { margin: 2px 0 0; color: var(--ink); font: 820 20px/1.2 var(--display); }
.analytics-chart { width: 100%; height: 340px; margin-top: 8px; }
.analytics-legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.analytics-legend span { display: flex; align-items: center; gap: 6px; }
.analytics-legend i { width: 18px; height: 3px; border-radius: 4px; background: var(--analytics-purple); }
.analytics-legend i.is-previous { background: #f0aa98; }
.analytics-chart-fallback { padding: 40px 10px; color: var(--muted); text-align: center; }

.analytics-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.analytics-list-card { grid-column: span 4; min-width: 0; padding: 20px; border-radius: 20px; }
.analytics-location-card { grid-column: span 4; }
.analytics-tech-card { grid-column: span 3; }
.analytics-list-card > header > span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.analytics-list { margin-top: 14px; }
.analytics-row, .analytics-empty { min-height: 45px; border-top: 1px solid var(--line); }
.analytics-row { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 0 8px; overflow: hidden; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; color: var(--ink); text-align: left; }
.analytics-row.has-icon { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; }
.analytics-row.has-favicon { min-height: 44px; }
.analytics-row-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--surface, #fffdfa) 82%, transparent); color: var(--muted); font-size: 14px; font-style: normal; line-height: 1; }
.analytics-row-icon img { display: block; width: 18px; height: 18px; object-fit: contain; }
.analytics-row-icon.is-flag { overflow: visible; border: 0; background: transparent; font-size: 18px; }
.analytics-row-icon.is-device { font-size: 17px; font-weight: 800; }
button.analytics-row { cursor: pointer; }
button.analytics-row:hover, button.analytics-row:focus-visible { color: var(--analytics-purple); }
.analytics-row::before { content: ''; position: absolute; z-index: 0; inset: 3px auto 3px 0; width: var(--analytics-progress, 0%); border-radius: 7px; background: rgba(105, 86, 200, .11); pointer-events: none; }
.analytics-row-label, .analytics-row-value { position: relative; z-index: 1; }
.analytics-row-label { min-width: 0; overflow: hidden; font-size: 13px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.analytics-row-label small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 600; }
.analytics-row-value { font-size: 13px; font-weight: 850; }
.analytics-page-table { width: 100%; margin-top: 10px; border-collapse: collapse; table-layout: fixed; }
.analytics-page-table th { padding: 0 8px 7px; color: var(--muted); font-size: 11px; font-weight: 800; text-align: right; text-transform: uppercase; }
.analytics-page-table th:first-child { text-align: left; }
.analytics-page-table th:nth-child(2) { width: 64px; }
.analytics-page-table th:nth-child(3) { width: 82px; }
.analytics-page-table td { height: 40px; padding: 0 8px; border-top: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.analytics-page-table-row { background: linear-gradient(to right, rgba(228, 107, 80, .13) 0 var(--analytics-progress), transparent var(--analytics-progress) 100%); }
.analytics-page-name { min-width: 0; font-weight: 700; }
.analytics-page-name button, .analytics-page-name span { display: block; width: 100%; min-width: 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.analytics-page-name button { cursor: pointer; }
.analytics-page-name button:hover, .analytics-page-name button:focus-visible { color: var(--analytics-purple); }
.analytics-page-views, .analytics-page-time { font-size: 13px; font-weight: 850; text-align: right; white-space: nowrap; }
.analytics-page-empty { height: 40px; color: var(--muted) !important; font-size: 12px !important; text-align: center; }
.analytics-empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.analytics-campaign-card { grid-column: span 4; }

.analytics-notes { margin-top: 14px; padding: 22px; border-radius: 22px; }
.analytics-note-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.analytics-note-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface, #fffdfa) 75%, transparent); }
.analytics-note-grid strong { color: var(--ink); font-size: 13px; }
.analytics-note-grid p, .analytics-details p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.analytics-notes details { margin-top: 12px; border-top: 1px solid var(--line); }
.analytics-notes summary { padding: 15px 2px 3px; color: var(--ink); font-size: 13px; font-weight: 800; cursor: pointer; }
.analytics-details { padding: 5px 2px 3px; }
.analytics-details pre { max-width: 100%; padding: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #27242e; color: #f8f5ff; font: 12px/1.55 ui-monospace, monospace; }
.analytics-site .site-footer { margin-bottom: 26px; }

@media (prefers-color-scheme: dark) {
    .analytics-site { --analytics-purple-soft: #302a4c; --analytics-green: #72caae; }
    .analytics-hero aside { border-color: #315f51; background: rgba(29, 65, 54, .65); color: #9addc8; }
    .analytics-range-picker button.is-active, .analytics-range-picker button:hover { color: #d8d0ff; }
    .analytics-filter-bar button { border-color: #514784; background: #312b4d; color: #d7d0ff; }
    .analytics-summary article:nth-child(2)::after { background: #4a3629; }
    .analytics-summary article:nth-child(3)::after { background: #263f36; }
    .analytics-gap-warning { border-color: #6c5728; background: #3c351f; color: #eed58c; }
}

@media (max-width: 820px) {
    .analytics-toolbar { grid-template-columns: 1fr auto; }
    .analytics-range-picker { grid-column: 1 / -1; overflow-x: auto; }
    .analytics-note-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .analytics-main { width: calc(100% - 16px); }
    .analytics-main { padding-top: 28px; padding-bottom: 42px; }
    .analytics-hero { display: block; }
    .analytics-hero h1 { font-size: 36px; }
    .analytics-hero aside { display: inline-block; min-width: 0; margin-top: 18px; }
    .analytics-toolbar { grid-template-columns: 1fr; padding: 12px; }
    .analytics-range-picker { grid-column: 1; }
    .analytics-range-picker { flex-wrap: wrap; overflow: visible; }
    .analytics-range-picker legend { float: none; flex: 0 0 100%; }
    .analytics-range-picker button { flex: 1 1 auto; padding-inline: 10px; }
    .analytics-export { grid-row: 3; }
    .analytics-custom-dates { grid-column: 1; flex-wrap: wrap; }
    .analytics-custom-dates label { width: calc(50% - 5px); }
    .analytics-summary { grid-template-columns: 1fr 1fr; }
    .analytics-summary article { min-height: 122px; padding: 16px; }
    .analytics-summary article:last-child { grid-column: 1 / -1; }
    .analytics-summary strong { font-size: 29px; }
    .analytics-chart-card { padding: 16px 10px; }
    .analytics-chart-card > header { padding: 0 6px; }
    .analytics-legend { display: none; }
    .analytics-chart { height: 280px; }
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-list-card, .analytics-location-card, .analytics-campaign-card { grid-column: 1; }
    .analytics-list-card, .analytics-notes { padding: 17px; }
    .analytics-note-grid { grid-template-columns: 1fr; }
}

/* Compact public report: flat, data-first controls and metrics. */
.analytics-site { background: #fbfaf8; }
.analytics-main { width: min(1088px, calc(100% - 32px)); }
.analytics-main { padding: 22px 0 48px; }

.analytics-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.analytics-compact-control {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 42px;
    border: 1px solid #dedad5;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(42, 37, 33, .045);
}
.analytics-compact-control .analytics-control-icon {
    display: grid;
    flex: 0 0 40px;
    place-items: center;
    height: 100%;
    margin: 0;
    border-right: 1px solid #eeeae6;
    color: var(--accent-ink);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}
.analytics-compact-control .analytics-control-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.analytics-toolbar .analytics-compact-control select {
    width: auto;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    padding: 0 32px 0 11px;
    border: 0;
    outline: 0;
    background-color: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
}
.analytics-site-picker { flex: 0 1 300px; }
.analytics-site-picker select { flex: 1; }
.analytics-range-picker { flex: 0 0 180px; padding: 0; overflow: visible; }
.analytics-range-picker select { flex: 1; }

.analytics-refresh,
.analytics-export,
.analytics-custom-dates button {
    display: inline-grid;
    place-items: center;
    height: 42px;
    min-height: 42px;
    border: 1px solid #dedad5;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(42, 37, 33, .045);
    color: var(--ink);
    font: 800 13px/1 var(--body);
    cursor: pointer;
}
.analytics-refresh { flex: 0 0 42px; padding: 0; font-size: 18px; }
.analytics-export { display: inline-flex; flex: 0 0 auto; gap: 5px; margin-left: auto; padding: 0 12px; text-decoration: none; }
.analytics-refresh:hover,
.analytics-refresh:focus-visible,
.analytics-export:hover,
.analytics-export:focus-visible,
.analytics-compact-control:focus-within { border-color: #d17b66; color: var(--accent-ink); }

.analytics-custom-dates {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: 2px;
    padding: 4px;
    border: 1px solid #dedad5;
    border-radius: 11px;
    background: #fff;
}
.analytics-custom-dates[hidden] { display: none; }
.analytics-custom-dates > span { color: #aaa39c; }
.analytics-custom-dates label { display: flex; align-items: center; width: auto; }
.analytics-custom-dates label > span { margin: 0 5px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.analytics-custom-dates input { width: 126px; min-height: 32px; height: 32px; padding: 0 5px; border: 0; background: transparent; font-size: 11px; }
.analytics-custom-dates button { height: 32px; min-height: 32px; padding: 0 10px; border-color: #dfa18f; background: #fff5f1; color: var(--accent-ink); }

.analytics-filter-bar { margin: 12px 0 0; }
.analytics-filter-bar button { border-color: #efc5b9; background: #fff2ed; color: var(--accent-ink); }
.analytics-chart-card {
    margin-top: 14px;
    padding: 0 20px 12px;
    border: 1px solid #e4e0dc;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(42, 37, 33, .045);
}
.analytics-summary {
    display: flex;
    gap: 0;
    margin: 0 -20px;
    border-bottom: 1px solid #eeeae6;
}
.analytics-summary article {
    flex: 1 1 20%;
    min-height: 0;
    padding: 16px 20px 14px;
    overflow: visible;
    border: 0;
    border-right: 1px solid #eeeae6;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.analytics-summary article::after { display: none; }
.analytics-summary span { font-size: 11px; font-weight: 650; letter-spacing: 0; }
.analytics-summary strong { margin: 5px 0 3px; font: 800 28px/1 var(--display); }
.analytics-summary small { min-height: 14px; font-size: 10px; }
.analytics-summary span > i { display: inline-block; width: 7px; height: 7px; margin-left: 3px; border-radius: 50%; background: #2fbd72; }
.analytics-chart-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding-top: 14px;
}
.analytics-chart-meta h1 { margin: 0; color: var(--ink); font: 800 16px/1.2 var(--display); }
.analytics-status { min-height: 0; margin: 3px 0 0; font-size: 10px; }
.analytics-legend i { background: #e46b50; }
.analytics-chart { height: 300px; margin-top: 0; }
.analytics-chart-tooltip-date { display: block; margin-bottom: 5px; font-weight: 800; }
.analytics-chart-tooltip-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-width: 138px; }
.analytics-chart-tooltip-row + .analytics-chart-tooltip-row { margin-top: 3px; }
.analytics-chart-tooltip-row i { width: 7px; height: 7px; border-radius: 50%; background: #e46b50; }
.analytics-chart-tooltip-row i.is-previous { background: #f0aa98; }
.analytics-chart-tooltip-row strong { margin-left: 8px; font-weight: 850; }
.analytics-gap-warning { margin: 10px 0 0; }

.analytics-map-card {
    position: relative;
    margin-top: 12px;
    padding: 16px 18px 12px;
    overflow: hidden;
    border: 1px solid #e4e0dc;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(42, 37, 33, .045);
}
.analytics-map-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.analytics-map-card h2 { margin: 2px 0 0; color: var(--ink); font: 820 16px/1.2 var(--display); }
.analytics-map-card .eyebrow { margin-bottom: 2px; font-size: 9px; }
.analytics-live-count { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.analytics-live-count i { width: 7px; height: 7px; border-radius: 50%; background: #2fbd72; box-shadow: 0 0 0 4px rgba(47, 189, 114, .12); animation: analytics-live-pulse 1.8s ease-out infinite; }
.analytics-live-count strong { color: var(--ink); font-size: 12px; }
.analytics-world-map { width: 100%; height: 360px; margin-top: 4px; }
.analytics-world-map[hidden] { display: none; }
.analytics-world-map.jvm-container { position: relative; width: 100%; height: 360px; overflow: hidden; }
.analytics-world-map.jvm-container svg { display: block; width: 100%; height: 100%; }
.analytics-world-map .jvm-region { vector-effect: non-scaling-stroke; }
.analytics-world-map .jvm-marker { cursor: pointer; }
.analytics-world-map .analytics-map-pin { fill: #e46b50; stroke: #fffdfa; stroke-width: 1.5; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(42, 37, 33, .24)); }
.analytics-world-map .analytics-map-pin-frame { fill: #fffdfa; stroke: #b94d39; stroke-width: 1.5; pointer-events: none; }
.analytics-world-map .analytics-map-avatar { filter: drop-shadow(0 1px 1px rgba(42, 37, 33, .18)); }
.analytics-world-map .analytics-map-avatar:focus-visible { outline: 2px solid #6956c8; outline-offset: 2px; }
.analytics-map-svg-tooltip { pointer-events: none; }
.analytics-map-svg-tooltip rect { fill: #fffdfa; stroke: #d9d2cb; stroke-width: 1; filter: drop-shadow(0 3px 5px rgba(42, 37, 33, .14)); }
.analytics-map-svg-tooltip text { fill: #342f2b; font-family: Poppins, sans-serif; font-size: 10px; }
.analytics-map-svg-tooltip-title { font-weight: 800; }
.analytics-map-svg-tooltip-stats { font-size: 9px; }
.analytics-map-empty { position: absolute; z-index: 3; top: 54%; left: 50%; margin: 0; padding: 9px 13px; transform: translate(-50%, -50%); border: 1px solid #e8e2dc; border-radius: 999px; background: rgba(255, 253, 250, .92); box-shadow: 0 3px 14px rgba(42, 37, 33, .08); color: var(--muted); font-size: 11px; text-align: center; white-space: nowrap; }
@keyframes analytics-live-pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 189, 114, .35); } 70%, 100% { box-shadow: 0 0 0 7px rgba(47, 189, 114, 0); } }

.analytics-grid { gap: 12px; margin-top: 12px; }
.analytics-list-card {
    padding: 16px;
    border: 1px solid #e4e0dc;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(42, 37, 33, .045);
}
.analytics-list-card h2 { font-size: 16px; }
.analytics-list-card .eyebrow { margin-bottom: 2px; font-size: 9px; }
.analytics-list { margin-top: 10px; }
.analytics-row, .analytics-empty { min-height: 40px; }
.analytics-row::before { background: rgba(228, 107, 80, .13); }
.analytics-notes {
    margin-top: 12px;
    padding: 3px 16px 9px;
    border: 1px solid #e4e0dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(42, 37, 33, .045);
}
.analytics-notes details { margin: 0; border-top: 0; }
.analytics-notes details + details { border-top: 1px solid #eeeae6; }
.analytics-notes summary { padding: 12px 2px 4px; font-size: 12px; }
.analytics-details { max-width: 850px; }

@media (prefers-color-scheme: dark) {
    .analytics-site { background: var(--canvas); }
    .analytics-compact-control,
    .analytics-refresh,
    .analytics-export,
    .analytics-custom-dates,
    .analytics-chart-card,
    .analytics-map-card,
    .analytics-list-card,
    .analytics-notes { border-color: var(--line); background: var(--surface); }
    .analytics-map-svg-tooltip rect { fill: #242126; stroke: #4d4742; }
    .analytics-map-svg-tooltip text { fill: #f6f1eb; }
    .analytics-map-empty { border-color: var(--line); background: rgba(40, 37, 42, .92); }
    .analytics-world-map .analytics-map-pin { stroke: #242126; }
    .analytics-world-map .analytics-map-pin-frame { fill: #242126; stroke: #f08d76; }
    .analytics-compact-control .analytics-control-icon,
    .analytics-summary,
    .analytics-summary article,
    .analytics-notes details + details { border-color: var(--line); }
}

@media (max-width: 760px) {
    .analytics-main { width: calc(100% - 16px); }
    .analytics-main { padding-top: 14px; }
    .analytics-toolbar { flex-wrap: wrap; padding: 0; }
    .analytics-site-picker { flex: 1 0 100%; }
    .analytics-range-picker { flex: 1 1 150px; }
    .analytics-export { grid-row: auto; margin-left: 0; }
    .analytics-custom-dates { display: grid; order: 10; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; margin: 0; }
    .analytics-custom-dates[hidden] { display: none; }
    .analytics-custom-dates > span { display: none; }
    .analytics-custom-dates label { min-width: 0; width: auto; }
    .analytics-custom-dates input { min-width: 0; width: 100%; }
    .analytics-custom-dates button { grid-column: 1 / -1; width: 100%; }
    .analytics-chart-card { margin-top: 10px; padding: 0 12px 10px; }
    .analytics-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-inline: -12px; }
    .analytics-summary article { min-height: 0; padding: 13px 12px 11px; border-bottom: 1px solid #eeeae6; }
    .analytics-summary article:nth-child(2n) { border-right: 0; }
    .analytics-summary article:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
    .analytics-summary strong { font-size: 23px; }
    .analytics-summary small { font-size: 9px; line-height: 1.25; }
    .analytics-chart-meta { padding: 12px 2px 0; }
    .analytics-chart { height: 250px; }
    .analytics-map-card { padding: 14px 10px 10px; }
    .analytics-map-card > header { padding-inline: 4px; }
    .analytics-world-map, .analytics-world-map.jvm-container { height: 250px; margin-top: 2px; }
    .analytics-map-svg-tooltip text { font-size: 9px; }
    .analytics-map-svg-tooltip-stats { font-size: 8px; }
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-campaign-card { grid-column: 1; }
    .analytics-list-card { padding: 15px; }
    .analytics-notes { padding-inline: 13px; }
}

@media (max-width: 360px) {
    .analytics-summary article { padding-inline: 9px; }
    .analytics-summary span { font-size: 9px; }
    .analytics-summary strong { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
    .analytics-live-count i { animation: none; }
}
