:root {
    color-scheme:light;
    --paper:#f3f1eb;
    --card:#fffef9;
    --ink:#243d32;
    --muted:#68746b;
    --line:#dedfd5;
    --green:#285c43;
    --amber:#ac7625;
}
* {
    box-sizing:border-box;
}
body {
    margin:0;
    background:var(--paper);
    color:var(--ink);
    font:15px/1.5 system-ui,-apple-system,sans-serif;
}
a {
    color:inherit;
    text-underline-offset:4px;
}
button,input,select {
    font:inherit;
}
button,a,input,select,summary {
    touch-action:manipulation;
}
button {
    cursor:pointer;
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,svg:focus-visible {
    outline:3px solid #b38f44;
    outline-offset:4px;
}
h1,h2,h3,p {
    margin-top:0;
}
h1 {
    font:400 clamp(36px,4vw,48px)/1.15 Georgia,serif;
    letter-spacing:-1px;
    margin-bottom:12px;
}
h2 {
    font:400 27px/1.25 Georgia,serif;
    margin-bottom:20px;
    overflow-wrap:anywhere;
}
h3 {
    font:400 24px Georgia,serif;
}
.muted,.fine {
    color:var(--muted);
}
.fine {
    font-size:12px;
    line-height:1.7;
}
.eyebrow {
    font-size:10px;
    letter-spacing:1.7px;
    font-weight:650;
    margin-bottom:12px;
}
.brand {
    text-decoration:none;
    font:600 34px/1 Georgia,serif;
    letter-spacing:-1.5px;
}
.brand-dot {
    color:var(--amber);
}
.primary {
    border:0;
    border-radius:8px;
    background:var(--green);
    color:white;
    min-height:44px;
    padding:10px 22px;
    font-weight:600;
}
.primary:hover {
    background:#184a33;
}
.quiet {
    background:none;
    border:1px solid var(--line);
    padding:8px 15px;
    border-radius:8px;
    color:var(--ink);
}
label,.filter-label {
    display:block;
    font-size:12px;
    font-weight:600;
    margin-bottom:7px;
}
input,select {
    height:44px;
    width:100%;
    min-width:0;
    border:1px solid var(--line);
    border-radius:7px;
    padding:8px 10px;
    background:var(--card);
    color:var(--ink);
}
.error {
    background:#fcece5;
    border:1px solid #ebc9b7;
    color:#8b3421;
    padding:12px 16px;
    border-radius:8px;
}
.login {
    min-height:100svh;
    display:grid;
    place-items:center;
    padding:24px;
}
.login-card {
    width:min(100%,440px);
    background:var(--card);
    border:1px solid var(--line);
    border-radius:18px;
    padding:44px;
}
.login-card>.brand {
    display:block;
    margin-bottom:48px;
}
.login-card h1 {
    font-size:43px;
}
.login-card form {
    margin-top:30px;
}
.login-card .primary {
    width:100%;
    display:flex;
    justify-content:space-between;
    margin-top:18px;
}
.login-card .fine {
    margin:30px 0 0;
}
.topbar {
    height:88px;
    padding:0 max(24px,calc((100vw - 1240px)/2));
    display:flex;
    align-items:center;
    gap:55px;
    border-bottom:1px solid var(--line);
}
.topbar nav {
    display:flex;
    align-self:stretch;
    gap:30px;
}
.topbar nav a {
    display:flex;
    align-items:center;
    text-decoration:none;
    color:var(--muted);
    font-size:14px;
    border-bottom:2px solid transparent;
}
.topbar nav a[aria-current] {
    border-color:var(--green);
    color:var(--ink);
}
.topbar>form {
    margin-left:auto;
}
.dashboard {
    max-width:1288px;
    padding:48px 24px 24px;
    margin:auto;
}
.page-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-bottom:30px;
}
.page-heading p:last-child {
    margin-bottom:0;
}
.pill {
    border:1px solid var(--line);
    border-radius:30px;
    padding:7px 14px;
    font-size:12px;
    white-space:nowrap;
    color:var(--muted);
}
.filters {
    display:grid;
    grid-template-columns:1.15fr 1.6fr .65fr 1fr 1fr auto;
    align-items:end;
    gap:14px;
    padding:22px;
    background:var(--card);
    border:1px solid var(--line);
    border-radius:12px;
}
.filters>div {
    min-width:0;
}
.app-picker {
    position:relative;
}
.app-picker>summary {
    height:44px;
    padding:10px;
    border:1px solid var(--line);
    border-radius:7px;
    cursor:pointer;
}
.app-picker>summary span {
    display:inline-block;
    max-width:calc(100% - 24px);
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    vertical-align:bottom;
}
.app-options {
    position:absolute;
    z-index:2;
    top:calc(100% + 6px);
    left:0;
    width:max(100%,280px);
    max-width:calc(100vw - 64px);
    max-height:320px;
    overflow:auto;
    padding:12px;
    background:var(--card);
    border:1px solid var(--line);
    border-radius:9px;
    box-shadow:0 8px 24px #243d321a;
}
.app-options p {
    margin:0 4px 8px;
}
.app-options label {
    display:flex;
    align-items:center;
    gap:10px;
    min-height:44px;
    padding:8px 4px;
    margin:0;
    font-size:14px;
    font-weight:400;
    cursor:pointer;
    overflow-wrap:anywhere;
}
.app-options label:hover {
    background:var(--paper);
}
.app-options input {
    flex:0 0 18px;
    width:18px;
    height:18px;
    accent-color:var(--green);
}
.range-note {
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    font-size:11px;
    color:var(--muted);
    margin:12px 3px 28px;
    gap:15px;
}
.timeline-presets {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}
.timeline-presets button {
    min-height:36px;
    padding:6px 12px;
    border:1px solid var(--line);
    border-radius:7px;
    background:var(--card);
    color:var(--ink);
    font-size:12px;
}
.timeline-presets button:hover {
    border-color:var(--green);
}
.timeline-presets button[aria-pressed="true"] {
    background:var(--green);
    border-color:var(--green);
    color:white;
}
.metrics {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin-bottom:24px;
}
.metric {
    padding:22px;
    background:var(--card);
    border:1px solid var(--line);
    border-radius:12px;
}
.metric>span,.metric>small {
    display:block;
    color:var(--muted);
    font-size:12px;
}
.metric>strong {
    display:block;
    font-size:36px;
    line-height:1.2;
    font-weight:500;
    letter-spacing:-1px;
    margin:14px 0 10px;
    font-variant-numeric:tabular-nums;
}
.metric em {
    font-size:18px;
    font-style:normal;
    color:var(--muted);
    letter-spacing:0;
}
.card {
    border:1px solid var(--line);
    border-radius:12px;
    background:var(--card);
    padding:28px;
}
.chart-heading {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
}
.chart-heading h2 {
    margin-bottom:0;
}
.chart-card .fine {
    margin-bottom:0;
}
#chart {
    min-height:260px;
    margin-top:26px;
}
#chart svg {
    display:block;
    width:100%;
    height:auto;
    max-height:440px;
    overflow:visible;
}
#chart .grid {
    stroke:var(--line);
    stroke-width:1;
}
#chart text {
    fill:var(--muted);
    font:12px system-ui,sans-serif;
}
#chart .series {
    fill:none;
    stroke-width:2.5;
    stroke-linejoin:round;
    stroke-linecap:round;
}
#chart .cursor {
    stroke:var(--amber);
    stroke-width:1;
    stroke-dasharray:4 4;
}
#chart .missing {
    stroke:var(--muted);
    stroke-width:1.5;
}
.chart-readout {
    font-size:13px;
    min-height:24px;
    margin:12px 0;
    color:var(--green);
    font-variant-numeric:tabular-nums;
}
.chart-legend,.chart-readout ul {
    display:flex;
    flex-wrap:wrap;
    gap:8px 24px;
    list-style:none;
    padding:0;
    margin:12px 0;
}
.chart-legend li {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:13px;
    overflow-wrap:anywhere;
}
.chart-legend svg {
    flex:0 0 24px;
    width:24px;
    height:12px;
}
.coverage-note {
    margin-top:-10px;
}
.data-table {
    margin-top:20px;
    padding:20px 28px;
}
.data-table summary {
    cursor:pointer;
    font-weight:500;
}
.data-table summary span {
    float:right;
    color:var(--muted);
    font-size:12px;
}
.table-scroll {
    max-height:430px;
    overflow:auto;
    margin-top:16px;
}
table {
    width:100%;
    border-collapse:collapse;
    font-size:13px;
    text-align:left;
}
th,td {
    padding:10px;
    border-bottom:1px solid var(--line);
}
thead th {
    position:sticky;
    top:0;
    background:var(--card);
    font-weight:600;
}
.info-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}
.upload-time {
    font-size:21px;
    font-variant-numeric:tabular-nums;
}
.info-grid dl {
    margin:0;
}
.info-grid dl>div {
    display:flex;
    justify-content:space-between;
    gap:18px;
    border-bottom:1px solid var(--line);
    padding:12px 0;
    font-size:13px;
}
.info-grid dt {
    color:var(--muted);
}
.info-grid dd {
    margin:0;
    text-align:right;
}
.note-card {
    background:#e8ede4;
}
.note-card p:not(.eyebrow) {
    color:#4e6354;
    font-size:14px;
}
.empty {
    text-align:center;
    padding:65px 30px;
}
.empty p {
    max-width:490px;
    margin-inline:auto;
}
.empty p:last-child {
    margin-bottom:0;
}
footer {
    display:flex;
    justify-content:space-between;
    margin-top:36px;
    padding-top:20px;
    border-top:1px solid var(--line);
    color:var(--muted);
    font-size:12px;
}
@media(max-width:1000px) {
    .filters {
        grid-template-columns:1fr 1.5fr 1fr;
    }
    .metrics {
        grid-template-columns:1fr 1fr;
    }
    .topbar {
        gap:30px;
    }
    #chart {
        min-height:180px;
    }
}
@media(max-width:760px) {
    .topbar {
        height:auto;
        min-height:80px;
        padding:18px 20px;
        gap:18px;
        flex-wrap:wrap;
    }
    .topbar nav {
        gap:8px 18px;
        order:3;
        width:100%;
        flex-wrap:wrap;
    }
    .topbar nav a {
        min-height:36px;
    }
}
@media(max-width:600px) {
    .topbar .brand {
        font-size:29px;
    }
    .topbar nav a {
        font-size:13px;
    }
    .dashboard {
        padding:30px 16px 20px;
    }
    .page-heading {
        align-items:flex-start;
    }
    .page-heading>.pill {
        display:none;
    }
    .filters {
        grid-template-columns:1fr 1fr;
        padding:16px;
        gap:12px;
    }
    .app-filter {
        grid-column:span 1;
    }
    .purchases-dashboard .filters>div:first-child,
    .purchases-dashboard .app-filter {
        grid-column:1 / -1;
    }
    .app-options {
        left:auto;
        right:0;
    }
    .metrics {
        gap:10px;
    }
    .metric {
        padding:16px;
    }
    .metric>strong {
        font-size:29px;
    }
    .metric>span,.metric>small {
        font-size:11px;
    }
    .range-note {
        flex-direction:column;
        align-items:flex-start;
        gap:6px;
    }
    .timeline-presets button {
        min-height:44px;
    }
    .card {
        padding:20px;
    }
    .chart-heading {
        display:block;
    }
    .chart-heading .pill {
        display:inline-block;
        margin-top:16px;
    }
    .info-grid {
        grid-template-columns:1fr;
    }
    .login-card {
        padding:30px;
    }
    .login-card h1 {
        font-size:39px;
    }
    #chart {
        min-height:130px;
    }
    .chart-readout {
        font-size:12px;
    }
    .data-table summary span {
        float:none;
        margin-left:12px;
    }
    th,td {
        padding:9px 6px;
        font-size:12px;
    }
    .info-grid dl>div {
        flex-wrap:wrap;
    }
    .upload-time {
        font-size:18px;
    }
}

.ingestion-row {
    display:grid;
    grid-template-columns:1fr 160px 1fr;
    align-items:center;
    gap:20px;
    padding:22px 0;
    border-bottom:1px solid var(--line);
}
.ingestion-row:last-child { border-bottom:0; }
.ingestion-row h2 { font-size:22px; margin-bottom:4px; }
.ingestion-time { text-align:right; font-variant-numeric:tabular-nums; }
.ingestion-time small { display:block; color:var(--muted); margin-top:5px; }
@media(max-width:600px) {
    .ingestion-row { grid-template-columns:1fr auto; gap:12px; }
    .ingestion-time { grid-column:1 / -1; text-align:left; }
}

/* The rolling-week dashboard keeps its layout independent of Downloads. */
.weekly-dashboard .weekly-filters {
    grid-template-columns:1fr 1.3fr auto auto;
}
.weekly-period {
    margin-left:18px;
}
.weekly-period .timeline-presets {
    flex-wrap:nowrap;
    gap:0;
    border:1px solid var(--line);
    border-radius:8px;
    overflow:hidden;
}
.weekly-period button {
    min-height:44px;
    border:0;
    border-radius:0;
    padding-inline:16px;
}
.weekly-period button:focus-visible {
    outline-offset:-4px;
}
.weekly-anchor {
    margin:14px 2px 24px;
}
.weekly-dashboard .metric:first-child {
    background:#e8ede4;
    border-color:#cbd8ca;
}
.weekly-delta.positive {
    color:#285c43;
}
.weekly-delta.negative {
    color:#a13f35;
}
.change-swatch {
    width:24px;
    height:12px;
    background:#c29a56;
}
#chart .change-bar {
    fill:#c29a56;
    fill-opacity:.65;
}
#chart .change-baseline {
    stroke:#9b7335;
    stroke-dasharray:3 3;
}
#chart .change-axis {
    fill:#856027;
}
.weekly-breakdown {
    margin-top:24px;
}
.weekly-table-wrap {
    max-height:560px;
    overflow:auto;
    margin-top:24px;
}
.weekly-table-wrap:focus-visible {
    outline:3px solid #b38f44;
    outline-offset:4px;
}
.weekly-table th,.weekly-table td {
    padding:16px 12px;
    font-variant-numeric:tabular-nums;
}
.weekly-table tbody th {
    font-weight:500;
}
.weekly-table th:not(:first-child),.weekly-table td {
    text-align:right;
}
.weekly-table small {
    display:block;
    font-weight:400;
    font-size:11px;
    color:var(--muted);
    margin-top:4px;
}
.weekly-table tbody tr:first-child {
    background:#eef2e9;
}
.weekly-method {
    margin:20px 0 0;
    max-width:850px;
}
@media(max-width:1000px) {
    .weekly-dashboard .weekly-filters {
        grid-template-columns:1fr 1.3fr auto;
    }
    .weekly-period {
        grid-column:1 / -1;
        margin:0;
    }
    .weekly-period button {
        flex:1;
    }
}
@media(max-width:600px) {
    .weekly-dashboard h1 {
        font-size:34px;
    }
    .weekly-dashboard .weekly-filters {
        grid-template-columns:minmax(0,1fr) auto;
    }
    .weekly-filters>div:first-child {
        grid-column:1 / -1;
    }
    .weekly-filters .app-options {
        left:0;
        right:auto;
    }
    .weekly-period button {
        padding-inline:8px;
    }
    .weekly-dashboard .chart-heading {
        display:flex;
    }
    .weekly-dashboard .chart-heading .pill {
        margin-top:0;
    }
    .weekly-dashboard .chart-heading h2 {
        font-size:24px;
    }
    .weekly-table th,.weekly-table td {
        padding:14px 4px;
        font-size:12px;
    }
    .weekly-table tbody th {
        max-width:135px;
    }
    .weekly-table small {
        font-size:10px;
    }
    .weekly-dashboard .metric>strong {
        font-size:clamp(21px,6.5vw,29px);
        overflow-wrap:anywhere;
    }
}
