:root { color-scheme: light; --surface: #fff8ed; --text: #3b251c; --border: #decbba; --ml-focus-color: #a6441d; }
* { box-sizing: border-box; }
body { margin: 0; background: #f7eedf; color: var(--text); font-family: Manrope, system-ui, sans-serif; font-size: var(--ml-font-min); line-height: 1.6; }
a { color: inherit; text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, .statistics-presets a, a.statistics-primary { border: 1px solid #bda38e; border-radius: 10px; background: var(--surface); color: var(--text); padding: 10px 18px; cursor: pointer; }
button:hover, .statistics-presets a:hover { background: #f0dfca; }
input, select { width: 100%; min-width: 0; border: 1px solid #bda38e; border-radius: 10px; padding: 10px 12px; background: #fffdf8; color: var(--text); }
select { appearance: none; padding-right: 44px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: max(var(--ml-font-min), 2.5rem); line-height: 1.2; letter-spacing: -.04em; }
h2 { margin-bottom: 10px; font-size: max(var(--ml-font-min), 1.25rem); line-height: 1.4; }
.statistics-shell { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.statistics-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-block: 24px; border-bottom: 1px solid var(--border); }
.statistics-brand { font-size: max(var(--ml-font-min), 1.25rem); font-weight: 800; text-decoration: none; }
.statistics-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.statistics-header nav > a { display: inline-flex; align-items: center; min-height: 44px; }
.statistics-header form { margin: 0; }
main { padding-block: 36px 48px; }
.statistics-heading { margin-bottom: 28px; }
.statistics-selection-summary { color: #715747; }
.statistics-selection-summary { margin-bottom: 24px; font-weight: 700; }
.statistics-eyebrow { margin-bottom: 8px; color: #9b451f; font-weight: 800; }
.statistics-login { max-width: 480px; margin: 28px auto 72px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.statistics-login form { display: grid; gap: 10px; }
.statistics-login label:not(:first-of-type) { margin-top: 10px; }
.statistics-login-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); gap: 8px; margin-bottom: 12px; }
.statistics-login-methods [aria-pressed="true"] { background: #3b251c; color: #fff8ed; border-color: #3b251c; }
.statistics-login-fields { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.statistics-login-fields[hidden] { display: none; }
.statistics-login-fields p { margin-bottom: 8px; }
.statistics-primary, a.statistics-primary { margin-top: 14px; background: #3b251c; color: #fff8ed; font-weight: 800; }
a.statistics-primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.statistics-primary:hover { background: #5d3929; }
.statistics-notice { border-left: 4px solid #a6441d; padding: 16px 20px; background: #fff4e4; }
.statistics-filters { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.statistics-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.statistics-presets a { display: inline-flex; align-items: center; text-decoration: none; }
.statistics-presets [aria-current] { background: #3b251c; color: #fff8ed; border-color: #3b251c; }
.statistics-filters form { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; width: 100%; }
.statistics-date-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.statistics-filters label { display: grid; gap: 4px; }
.statistics-filters :is(label, form, .statistics-date-fields) { min-width: 0; }
.statistics-filters input { max-width: 200px; }
.statistics-refresh[aria-disabled="true"] { opacity: .6; cursor: progress; }
.statistics-update-status { min-height: 1.6em; margin-bottom: 16px; }
[data-statistics-report][aria-busy="true"] { opacity: .65; }
.statistics-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.statistics-metrics section, .statistics-panel { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.statistics-metrics h2 { font-size: var(--ml-font-min); font-weight: 600; }
.statistics-metrics p { margin: 0; font-size: max(var(--ml-font-min), 2.5rem); font-weight: 800; line-height: 1.3; }
.statistics-metrics small { display: block; margin-top: 8px; }
.statistics-panel { margin-bottom: 20px; container: statistics-panel / inline-size; }
.statistics-panel-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 12px; }
.statistics-panel-heading > a { display: inline-flex; align-items: center; min-height: 44px; }
.statistics-panel p { color: #715747; }
.statistics-chart { display: block; width: 100%; height: clamp(150px, 20vw, 240px); margin-block: 12px; overflow: visible; }
.statistics-chart-labels { display: flex; justify-content: space-between; color: #715747; }
.statistics-axis { stroke: #c4aa94; stroke-width: 1; }
.statistics-view-bar, .statistics-hours rect { fill: #a6441d; }
.statistics-visitor-bar { fill: #d99c48; }
.statistics-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-block: 10px 16px; }
.statistics-legend span::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 4px; background: #a6441d; }
.statistics-legend .statistics-visitor-key::before { background: #d99c48; }
.statistics-daily summary { cursor: pointer; min-height: 44px; padding-block: 10px; }
.statistics-diagnostics { min-width: 0; margin-bottom: 24px; }
.statistics-diagnostics summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-weight: 700; }
.statistics-diagnostics table { min-width: 60rem; }
.statistics-diagnostics td { white-space: nowrap; }
[data-scroll-region] { overflow-x: auto; }
[data-scroll-hint]::before { display: none; content: attr(data-scroll-hint); position: sticky; left: 0; margin-bottom: 8px; color: #715747; }
[data-scroll-hint][data-ml-scroll-region]::before { display: block; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th:first-child { padding-left: 0; overflow-wrap: anywhere; }
td, th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
tbody th { font-weight: 500; }
th.statistics-page-path, td.statistics-page-path { text-align: left; overflow-wrap: anywhere; }
.statistics-sort { display: inline-flex; align-items: center; justify-content: flex-end; gap: .35em; min-height: 44px; font-weight: 700; text-decoration: none; }
.statistics-sort:hover, .statistics-sort:focus-visible { text-decoration: underline; }
th:first-child .statistics-sort, .statistics-page-path .statistics-sort, .statistics-source-label .statistics-sort { justify-content: flex-start; }
.statistics-sort > span[aria-hidden="true"] { flex: none; color: #9b451f; }
.statistics-sources table { min-width: 62rem; }
.statistics-sources th:first-child { min-width: 10rem; }
.statistics-source-label { text-align: left !important; overflow-wrap: anywhere; }
.statistics-source-label small { display: block; color: #715747; }
.statistics-site-breakdown table { min-width: 36rem; }
.statistics-site-breakdown th:not(:first-child) { white-space: nowrap; }
.statistics-site-breakdown tbody th, .statistics-site-breakdown tbody td { padding-block: 4px; }
.statistics-site-breakdown tbody a { display: inline-block; min-height: 44px; max-width: 100%; padding-block: 8px; }
.statistics-pages-multiple table { min-width: 30rem; }
.statistics-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.statistics-hours { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 6px; }
.statistics-hours > div { min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
.statistics-hours svg { display: block; width: 100%; height: 60px; margin-block: 6px; }
.statistics-hours strong { font-size: var(--ml-font-min); font-weight: 500; }
.statistics-hours .statistics-hour-horizontal, .statistics-hours-heading, .statistics-label-short, .statistics-date-short { display: none; }
.statistics-label-short { text-decoration: none; }
.statistics-project-name { hyphens: manual; }
.statistics-empty { padding: 24px; margin-bottom: 24px; border: 1px dashed #bda38e; border-radius: 18px; }
.statistics-empty p { margin-bottom: 0; }
.statistics-explanation { color: #715747; max-width: 85ch; margin-top: 10px; }
.statistics-explanation > a { display: inline-flex; align-items: center; min-height: 44px; }
.ml-site-footer { --muted: #715747; --text: #3b251c; --line: #decbba; padding-block: 24px; }
@media (max-width: 50rem) { .statistics-bottom-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 34rem) { .statistics-pages-multiple [data-scroll-hint]::before { display: block; } }
@media (max-width: 37.5rem) {
    .statistics-site-breakdown [data-scroll-hint]::before { display: block; }
    .statistics-shell { width: calc(100% - 28px); }
    .statistics-header { flex-wrap: wrap; gap: 10px; padding-block: 18px; }
    .statistics-header nav { justify-content: space-between; width: 100%; gap: 10px; }
    main { padding-top: 24px; }
    .statistics-metrics { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .statistics-metrics section { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); align-items: center; gap: 8px 16px; }
    .statistics-metrics h2 { margin: 0; }
    .statistics-metrics small { grid-column: 1 / -1; margin: 0; }
    .statistics-login, .statistics-panel, .statistics-metrics section { padding: 18px; }
    .statistics-date-fields { display: grid; width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
    .statistics-filters input { width: 100%; max-width: none; }
    .statistics-date-fields button { grid-column: 1 / -1; }
    .statistics-hours { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .statistics-presets { width: 100%; }
    .statistics-presets a { flex: 1 1 8rem; justify-content: center; }
    .statistics-metrics p { overflow-wrap: anywhere; text-align: end; }
    .statistics-chart { height: clamp(100px, 24vw, 150px); }
    .statistics-filters form > button { width: 100%; }
    .statistics-chart-labels { flex-wrap: wrap; gap: 4px 16px; }
}

/* Compact statistics typography is an explicit user preference for these tables. */
@container statistics-panel (max-width: 38em) {
    .statistics-panel .statistics-compact-table { --ml-font-min: max(16px, 1rem); font-size: var(--ml-font-min); table-layout: fixed; min-width: 0; }
    .statistics-panel .statistics-compact-table :is(th, td) { padding: 8px 4px; white-space: normal; overflow-wrap: anywhere; }
    .statistics-compact-table :is(th, td):first-child { padding-inline-start: 0; }
    .statistics-compact-table th:first-child { width: 72%; }
    .statistics-compact-table.statistics-three-columns th:first-child { width: 36%; }
    .statistics-compact-table.statistics-three-columns th:nth-child(2) { width: 28%; }
    .statistics-compact-table.statistics-three-columns th:last-child { width: 36%; }
    .statistics-pages-multiple .statistics-compact-table th:nth-child(2) { width: 36%; }
    .statistics-pages-multiple .statistics-compact-table th:last-child { width: 28%; }
    .statistics-compact-table .statistics-sort { flex-wrap: wrap; max-width: 100%; gap: 0 .2em; }
    .ml-admin-shell .statistics-compact-table .statistics-sort { overflow-wrap: normal; }
    .statistics-compact-table :is(.statistics-label-full, .statistics-date-full) { display: none; }
    .statistics-compact-table :is(.statistics-label-short, .statistics-date-short) { display: inline; }
    .statistics-daily [data-scroll-hint]::before, .statistics-site-breakdown [data-scroll-hint]::before, .statistics-pages-multiple [data-scroll-hint]::before { display: none; }
}
@container ml-admin (max-width: 50em) {
    .statistics-card-table { --ml-font-min: max(16px, 1rem); font-size: var(--ml-font-min); }
    .ml-admin-shell .statistics-card-table > tbody > tr:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
    .ml-admin-shell .statistics-card-table .statistics-sort { justify-content: space-between; }
    .ml-admin-shell .statistics-long-values > tbody > tr:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
    .ml-admin-shell .ml-admin-card-table.statistics-long-values > :is(thead, tbody) > tr > :is(th, td) { width: auto; }
    .statistics-sources [data-scroll-hint]::before, .statistics-diagnostics [data-scroll-hint]::before { display: none; }
}
/* Preserve large text by stacking compact rows when three columns cannot fit. */
@container statistics-panel (max-width: 12em) {
    .statistics-compact-table, .statistics-compact-table > :is(thead, tbody) { display: block; width: 100%; }
    .statistics-compact-table > thead > tr { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
    .statistics-compact-table > thead > tr > th { flex: 1 1 6rem; }
    .statistics-compact-table > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding-block: 12px; border-bottom: 1px solid var(--border); }
    .statistics-compact-table > :is(thead, tbody) > tr > :is(th, td) { display: block; width: auto !important; min-width: 0; padding: 0; border: 0; text-align: start; }
    .statistics-compact-table .ml-admin-mobile-label { display: block; margin-bottom: 4px; color: #715747; }
    .statistics-compact-table .statistics-sort { justify-content: start; }
}
@media (max-width: 50rem) {
    [data-statistics-report] [data-scroll-hint]::before { display: none; }
    .statistics-hours { grid-template-columns: minmax(0, 1fr); gap: 0; font-size: max(16px, 1rem); }
    .statistics-hours > div { display: grid; grid-template-columns: 2.5em minmax(0, 1fr) minmax(2ch, auto); align-items: center; gap: 12px; padding-block: 6px; border-bottom: 1px solid var(--border); text-align: start; line-height: 1.35; }
    .statistics-hours > div:last-child { border-bottom: 0; }
    .statistics-hours .statistics-hour-vertical { display: none; }
    .statistics-hours .statistics-hour-horizontal { display: block; height: 8px; margin: 0; border-radius: 4px; background: #f0dfca; }
    .statistics-hours strong { min-width: 0; text-align: end; font-size: inherit; overflow-wrap: anywhere; }
    .statistics-hours-heading { display: flex; justify-content: space-between; gap: 12px; color: #715747; font-size: max(16px, 1rem); }
}
