
        /* Reset */

            /* Box sizing rules */
            *,
            *::before,
            *::after {
            box-sizing: border-box;
            }

            /* Prevent font size inflation */
            html {
            -moz-text-size-adjust: none;
            -webkit-text-size-adjust: none;
            text-size-adjust: none;
            }

            /* Remove default margin in favour of better control in authored CSS */
            body, h1, h2, h3, h4, p,
            figure, blockquote, dl, dd {
            margin-block-end: 0;
            }

            /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
            ul[role='list'],
            ol[role='list'] {
            list-style: none;
            }

            /* Set core body defaults */
            body {
            min-height: 100vh;
            line-height: 1.5;
            }

            /* Set shorter line heights on headings and interactive elements */
            h1, h2, h3, h4,
            button, input, label {
            line-height: 1.1;
            }

            /* Balance text wrapping on headings */
            h1, h2,
            h3, h4 {
            text-wrap: balance;
            }

            /* A elements that don't have a class get default styles */
            a:not([class]) {
            text-decoration-skip-ink: auto;
            color: currentColor;
            }

            /* Make images easier to work with */
            img,
            picture {
            max-width: 100%;
            display: block;
            }

            /* Inherit fonts for inputs and buttons */
            input, button,
            textarea, select {
            font-family: inherit;
            font-size: inherit;
            }

            /* Make sure textareas without a rows attribute are not tiny */
            textarea:not([rows]) {
            min-height: 10em;
            }

            /* Anything that has been anchored to should have extra scroll margin */
            :target {
            scroll-margin-block: 5ex;
            }


        /* Styles */

            .auth-error {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                background: #d42020;
                color: white;
                font-weight: 600;
                text-align: center;
                padding: 10px;
            }

            .login-wrapper {
                margin: 100px auto 50px;
                width: 100%;
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
            }

            .login-wrapper form {
                margin: 0;
            }

            .login-wrapper .card {
                width: 500px;
                background: white;
                border-radius: 5px;
                box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
            }

            .login-wrapper .card .card-header {
                border-bottom: 1px solid #f5f5f5;
                padding: 15px;
                font-weight: 600;
            }

            .login-wrapper .card .card-body {
                padding: 30px 15px 15px;
            }

            .login-wrapper .card .card-body label {
                font-weight: 400;
                display: block;
                margin-bottom: 10px;
            }

            .login-wrapper .card .card-body input {
                padding: 10px;
                width: 100%;
                border-radius: 5px;
                border: 1px solid #dcdcdc;
                margin-bottom: 25px;
            }

            .login-wrapper .card button {
                background: #333333;
                color: white;
                border-radius: 5px;
                padding: 10px;
                margin-bottom: 0;
            }

            body {
                background: #f5f5f5;
                display: flex;
                flex-direction: column;
                padding: 80px 15px;
                font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
                justify-content: flex-start;
    align-items: flex-start;
            }

            nav.report-toggle {
                    background: white;
                border-radius: 50px;
                display: flex;
                margin: 100px 0 50px;
                width: auto;
                margin-left: calc(10vw - 15px);
                padding: 3px;
            }

            nav.report-toggle button {
                background: none;
                border: none;
                padding: 10px 20px;
                border-radius: 50px;
                cursor: pointer;
                color: #666;
            }

            nav.report-toggle button.active {
                background: black;
                color: white;
            }

            main {
                display: flex;
                width: 80vw;
                margin: 0 auto;
                flex-grow: 0;
            }

            #total {
                width: 330px;
                flex-grow: 0;
                flex-shrink: 0;
                padding: 30px 0;
            }

            .report {
                background: white;
                border-radius: 25px;
                box-shadow: 2px 2px rgba(0,0,0,0.025);
                overflow: hidden;
                width: 300px;
                flex-shrink: 0;
                flex-grow: 0;
                margin: 50px 15px;
            }

            #total .report,
            .report.current,
            .report.last-completed {
                transform: scale(1.1);
            }

            .report .report-section.header {
                background: black;
                color: white;
                padding: 20px;
                text-align: center;
            }

            .report .report-section.header .header-note {
                display: block;
                font-size: 0.75em;
                opacity: 0.7;
                min-height: 1.2em;
                margin-top: 4px;
            }

            .report .report-section {
                border-bottom: 1px solid lightgrey;
                padding: 20px;
            }

            .report .report-section:first-child,
            .report .report-section:last-child {
                border-bottom: 0;
            }

            .report .report-section h2 {
                margin: 0;
            }

            .report .report-section:not(.header) h2 {
                text-transform: uppercase;
                font-size: 18px;
                opacity: .5;
            }

            .report .report-section:not(.header) h3 {
                opacity: .4;
                font-size: 15px;
                text-transform: uppercase;
            }

            .report .report-section-topline {
                display: flex;
                justify-content: space-between;
                align-items: center;
                cursor: pointer;
                user-select: none;
            }

            .report .report-section-topline::after {
                content: '▾';
                font-size: 18px;
                opacity: 0.4;
                transition: transform 0.2s ease;
                display: inline-block;
            }

            .report .report-section.collapsed .report-section-topline::after {
                transform: rotate(-90deg);
            }

            .report .report-section-expansion {
                overflow: hidden;
                max-height: 600px;
                max-height: unset;
                transition: max-height 0.3s ease, opacity 0.3s ease;
                opacity: 1;
            }

            .report .report-section.collapsed .report-section-expansion {
                max-height: 0;
                opacity: 0;
            }

            /* ---- Sub-section collapse (inside Website Analytics) ---- */
            .report-sub-section {
                /* border-top: 1px solid rgba(0,0,0,0.08); */
                margin-top: 8px;
            }

            .report-sub-section-topline {
                display: flex;
                justify-content: space-between;
                align-items: center;
                cursor: pointer;
                user-select: none;
                padding: 8px 0 4px;
            }

            .report-sub-section-topline h3 {
                margin: 0;
            }

            .report-sub-section-topline::after {
                content: '▾';
                font-size: 13px;
                opacity: 0.35;
                transition: transform 0.2s ease;
                display: inline-block;
                flex-shrink: 0;
                margin-left: 6px;
            }

            .report-sub-section.collapsed .report-sub-section-topline::after {
                transform: rotate(-90deg);
            }

            .report-sub-section-expansion {
                overflow: hidden;
                max-height: unset;
                transition: max-height 0.3s ease, opacity 0.3s ease;
                opacity: 1;
            }

            .report-sub-section.collapsed .report-sub-section-expansion {
                max-height: 0 !important;
                opacity: 0;
            }

            #weekly {
                display: flex;
                width: calc( 80vw - 330px);
                flex-grow: 0;
                flex-shrink: 0;
                position: relative;
            }

            #weekly::before {
                content: "";
                position: absolute;
                left: 0;
                top: 0;
                bottom: 50px;
                width: 50px;
                pointer-events: none;
                z-index: 2;
                background: linear-gradient(to right, #f5f5f5, rgba(255,255,255,0));

            }

            #weekly::after {
                content: "";
                position: absolute;
                right: 0;
                top: 0;
                bottom: 50px;
                width: 50px;
                pointer-events: none;
                z-index: 2;
                background: linear-gradient(to left, #f5f5f5, rgba(255,255,255,0));

            }

            #weekly-scroll-container {
                display: flex;
                width: calc( 80vw - 330px);
                flex-grow: 0;
                flex-shrink: 0;
                overflow-x: auto;
                padding: 30px 50px;
            }

            #weekly .report {
                margin: 50px 15px;
            }

            #weekly .report {
                opacity: .5;
                transition: .3s all;
            }

            #weekly .report:hover {
                opacity: 1;
            }

            #weekly .report.last-completed {
                opacity: 1;
                margin: 50px 30px;
            }

            #weekly .report.current {
                opacity: .75;
                margin: 50px 30px;
            }

            header {

                width: 80vw;
                margin: 0 auto;
                display: flex;

                justify-content: space-between;
                align-items: center;
                flex-grow: 0;

            }

            header div {
                text-align: right;
            }

            header h1 {
                margin-top: 0;
            }

            header img {
                    height: 150px;
            }

            .stat-row {
                display: flex;
                justify-content: space-between;
                gap: 10px;
            }

            .stat-group {
                display: flex;
                flex-direction: column-reverse;
                margin-block-start: 1em;
            }

            .stat-row .stat-group:nth-child(even) {
                text-align: right;
            }

            .report .report-section:not(.header) .stat-group h3 {
                margin: 0;
                font-size: 13px;
                font-weight: normal;
                opacity: 0.4;
                text-transform: unset;
            }

            .comp-figure {
                display: block;
                font-size: 12px;
                font-weight: 500;
                opacity: 0.4;
                margin-top: 2px;
            }

            .comp-above {
                display: block;
                font-size: 11px;
                font-weight: 500;
                opacity: 0.55;
                margin-bottom: 3px;
            }

            .comp-figure::after {
                content: " *";
                text-transform: superscript;
            }

            .stat-row .stat-group:nth-child(even) .comp-figure::after {
                content: "";
            }

            .stat-row .stat-group:nth-child(even) .comp-figure::before {
                content: "* ";
                text-transform: superscript;
            }

            .comp-label {
                display: block;
                font-size: 11px;
                opacity: 0.35;
                text-transform: uppercase;
                letter-spacing: 0.05em;
                margin-top: 10px;
                margin-bottom: -4px;
            }

            .change-indicator {
                font-size: 11px;
                font-weight: 600;
                margin-left: 5px;
                margin-right: 5px;
                margin-top: 5px;
                vertical-align: middle;
                white-space: nowrap;
            }

            .change-up      { color: #22c55e; }
            .change-down    { color: #ef4444; }
            .change-neutral { color: #f97316; }

            .report .report-section:not(.header) .stat-group.stat-group-lg h3 {
                font-size: 15px;
                opacity: 0.5;
            }

            .stat-group .figure {
                font-size: 20px;
                font-weight: 700;
                margin-bottom: 2px;
                opacity: .8;
                display: flex;
            }

            .stat-row .stat-group:nth-child(even) .figure {
                flex-direction: row-reverse;
            }

            .stat-group.stat-group-lg .figure {
                font-size: 24px;
                font-weight: 700;
                margin-bottom: 2px;
                opacity: 1;
            }

            .attribution-toggle,
            .total-mode-toggle {
                display: inline-flex;
                background: #f0f0f0;
                border-radius: 50px;
                padding: 2px;
                margin: 10px 0 6px;
            }

            .attribution-toggle button,
            .total-mode-toggle button {
                background: none;
                border: none;
                padding: 4px 12px;
                border-radius: 50px;
                cursor: pointer;
                font-size: 11px;
                color: #666;
                font-weight: 500;
            }

            .attribution-toggle button.active,
            .total-mode-toggle button.active {
                background: black;
                color: white;
            }

            .report-section.header .total-mode-toggle {
                margin: 6px 0 0;
                background: rgba(255,255,255,0.15);
            }

            .report-section.header .total-mode-toggle button {
                color: rgba(255,255,255,0.6);
            }

            .report-section.header .total-mode-toggle button.active {
                background: white;
                color: black;
            }

            .source-list {
                margin-top: 8px;
                width: 100%;
            }

            .source-row {
                display: flex;
                justify-content: space-between;
                align-items: baseline;
                gap: 6px;
                padding: 4px 0;
                border-bottom: 1px solid #f0f0f0;
                font-size: 13px;
            }

            .source-row:last-child {
                border-bottom: none;
            }

            .source-name {
                opacity: 0.6;
                flex: 1;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                font-size: 12px;
            }

            .source-figures {
                display: flex;
                flex-direction: column;
                align-items: flex-end;
                flex-shrink: 0;
            }

            .source-figures .source-current {
                font-weight: 600;
                font-size: 13px;
            }

            .source-figures .comp-figure {
                margin-top: 0;
            }

            svg.external-link {
                height: 20px;
                width: 20px;
                float: right;
                position: relative;
                top: -2px;
            }


            .source-list {
                height: 300px;
                overflow-y: auto;
                padding-right: 5px;
            }

        .cron-status { font-weight: bold; cursor: help; border-bottom: 1px dotted currentColor; }
        .cron-status.ok    { color: #2a9d3a; }
        .cron-status.error { color: #c0392b; }
