@import url("fonts.70ab00fdca93.css");

:root {
    color-scheme: light dark;

    /*
     * Keep the --c- colors for use that does not depend on light/dark mode. Do
     * not re-assign --c- colors in the dark mode section. Use --fill- and
     * --text- variables that do flip on light/dark mode. See the color boards
     * for the designs of the fill/text color schemes.
     */

    --c-grayscale01:    hsl(0 0% 100%);
    --c-grayscale02:    hsl(0 0% 98%);
    --c-grayscale03:    hsl(0 0% 96%);
    --c-grayscale04:    hsl(0 0% 95%);
    --c-grayscale05:    hsl(0 0% 94%);
    --c-grayscale93:    hsl(0 0% 93%);
    --c-grayscale06:    hsl(0 0% 90%);
    --c-grayscale07:    hsl(0 0% 85%);
    --c-grayscale08:    hsl(0 0% 50%);
    --c-grayscale09:    hsl(0 0% 35%);
    --c-grayscale10:    hsl(0 0% 32%);
    --c-grayscale11:    hsl(0 0% 28%);
    --c-grayscale12:    hsl(0 0% 25%);
    --c-grayscale13:    hsl(0 0% 24%);
    --c-grayscale14:    hsl(0 0% 20%);
    --c-grayscale15:    hsl(0 0% 15%);
    --c-grayscale16:    hsl(0 0% 10%);

    --c-blue01:         hsl(220 84% 54%);
    --c-blue02:         hsl(212 98% 64%);
    --c-blue03:         hsl(212 98% 72%);
    --c-blue04:         hsl(216 88% 59%);

    --c-oceanblue01:    hsl(196 96% 24%);
    --c-oceanblue02:    hsl(196 96% 28%);
    --c-oceanblue03:    hsl(196 96% 32%);
    --c-oceanblue04:    hsl(196 96% 54%);
    --c-oceanblue05:    hsl(196 96% 88%);
    --c-oceanblue06:    hsl(196 96% 92%);
    --c-oceanblue07:    hsl(196 96% 96%);
    --c-oceanblue08:    hsl(196 96% 98%);

    --c-violet01:       hsl(232 40% 44%);
    --c-violet02:       hsl(232 40% 38%);
    --c-violet03:       hsl(232 40% 32%);

    --c-turquoise01:    hsl(160 84% 46%);
    --c-turquoise02:    hsl(160 72% 56%);
    --c-turquoise03:    hsl(160 72% 72%);
    --c-turquoise04:    hsl(160 84% 93%);

    --c-crimson01:      hsl(336 70% 50%);
    --c-crimson02:      hsl(336 70% 95%);

    --c-tangerine01:    hsl(30 94% 52%);
    --c-tangerine02:    hsl(30 86% 63%);
    --c-tangerine03:    hsl(30 94% 94%);

    --c-parakeet01:     hsl(136 63% 45%);
    --c-parakeet02:     hsl(136 63% 93%);

    --c-canary01:       hsl(50 100% 50%);
    --c-canary02:       hsl(50 100% 84%);
    --c-canary03:       hsl(50 84% 74%);

    --c-cobalt01:       hsl(220 84% 54%);
    --c-cobalt02:       hsl(220 84% 95%);

    --c-green:          hsl(136 63% 45%);
    --c-orange:         hsl(30  89% 52%);
    --c-red:            hsl(347 85% 60%);
    --c-deeppink:       hsl(328 100% 54%);

    --c-eggplant:       #730071;
    --c-purple:         #5a0095;
    --c-caramel:        #d27c00;
    --c-carmine:        #d90028;

    --c-dark-eggplant:  #a833a6;
    --c-dark-purple:    #6341b0;
    --c-dark-caramel:   #c87f15;
    --c-dark-carmine:   #d52e4c;

    --c-group00:        #293781;
    --c-group01:        #2f48b0;
    --c-group02:        #315ae1;
    --c-group03:        #007ef8;
    --c-group04:        #009afc;
    --c-group05:        #00b2f1;
    --c-group06:        #00c7de;
    --c-group07:        #00d9ca;
    --c-group08:        #6ce9bb;
    --c-group09:        #b3f7b6;

    --c-dark-group09:   hsl(182 100% 90%);
    --c-dark-group08:   hsl(182 100% 80%);
    --c-dark-group07:   hsl(182 100% 70%);
    --c-dark-group06:   hsl(182 100% 49%);
    --c-dark-group05:   hsl(182 100% 45%);
    --c-dark-group04:   hsl(182 100% 41%);
    --c-dark-group03:   hsl(182 100% 38%);
    --c-dark-group02:   hsl(182 100% 32%);
    --c-dark-group01:   hsl(182 100% 27%);
    --c-dark-group00:   hsl(182 100% 24%);

    /* These variables are used in the color boards */
    --fill-activity-disabled: light-dark(var(--c-grayscale03), var(--c-grayscale14));
    --fill-backdrop-nav:      light-dark(hsl(0 0% 40% / 0.5), hsl(0 0% 10% / 0.5));
    --fill-body:              light-dark(var(--c-grayscale04), var(--c-grayscale14));
    --fill-breton-even:       light-dark(var(--c-grayscale03), var(--c-grayscale11));
    --fill-breton-head:       light-dark(var(--c-grayscale05), var(--c-grayscale10));
    --fill-breton-odd:        light-dark(var(--c-grayscale02), var(--c-grayscale13));
    --fill-button:            light-dark(var(--c-grayscale05), var(--c-grayscale09));
    --fill-button2:           light-dark(var(--c-grayscale03), var(--c-grayscale11));
    --fill-field-border:      light-dark(var(--c-grayscale06), var(--c-grayscale09));
    --fill-field:             light-dark(var(--c-grayscale04), var(--c-grayscale14));

    --fill-highlight-activity:   light-dark(var(--c-turquoise04), var(--c-grayscale14));
    --fill-highlight-summary:    light-dark(var(--c-oceanblue08), var(--c-grayscale14));
    --fill-highlight-error:      light-dark(var(--c-crimson02), transparent);
    --fill-highlight-warning:    light-dark(var(--c-tangerine03), transparent);
    --fill-highlight-success:    light-dark(var(--c-parakeet02), transparent);
    --fill-highlight-info:       light-dark(var(--c-cobalt02), transparent);
    --fill-highlight-processing: light-dark(var(--c-canary02), transparent);

    --fill-btn-processing: light-dark(var(--c-canary03), var(--c-grayscale09));
    --fill-btn-warning:    light-dark(var(--c-tangerine02), var(--c-grayscale09));
    --fill-highlight:      light-dark(var(--c-oceanblue07), var(--c-grayscale14));
    --fill-loader:         var(--text-link);
    --fill-nav-shadow:     light-dark(hsl(0 0% 30% / 14%), hsl(0 0% 10% / 90%));
    --fill-overlay:        hsl(0 0% 0% / 50%);
    --fill-pill-active:    light-dark(var(--c-blue01), var(--c-blue02));

    --fill-pill-env-demo:         light-dark(var(--c-caramel), var(--c-dark-caramel));
    --fill-pill-env-development:  var(--c-green);
    --fill-pill-env-production:   light-dark(var(--c-carmine), var(--c-dark-carmine));
    --fill-pill-env-staging:      light-dark(var(--c-purple), var(--c-dark-purple));
    --fill-pill-env-test:         light-dark(var(--c-purple), var(--c-dark-purple));
    --fill-pill-on-body:          light-dark(var(--c-grayscale06), var(--c-grayscale09));
    --fill-pill-on-tile:          light-dark(var(--c-grayscale03), var(--c-grayscale12));
    --fill-separator-on-body:     light-dark(var(--c-grayscale07), var(--c-grayscale12));
    --fill-separator-on-tile:     light-dark(var(--c-grayscale06), var(--c-grayscale12));
    --fill-separator-on-tile-alt: light-dark(var(--c-grayscale07), var(--c-grayscale11));

    --fill-step-0: light-dark(var(--c-group00), var(--c-dark-group00));
    --fill-step-1: light-dark(var(--c-group01), var(--c-dark-group01));
    --fill-step-2: light-dark(var(--c-group02), var(--c-dark-group02));
    --fill-step-3: light-dark(var(--c-group03), var(--c-dark-group03));
    --fill-step-4: light-dark(var(--c-group04), var(--c-dark-group04));
    --fill-step-5: light-dark(var(--c-group05), var(--c-dark-group05));
    --fill-step-6: light-dark(var(--c-group06), var(--c-dark-group06));
    --fill-step-7: light-dark(var(--c-group07), var(--c-dark-group07));
    --fill-step-8: light-dark(var(--c-group08), var(--c-dark-group08));
    --fill-step-9: light-dark(var(--c-group09), var(--c-dark-group09));

    --fill-tile:     light-dark(var(--c-grayscale01), var(--c-grayscale15));
    --fill-toggle:   light-dark(var(--c-grayscale04), var(--c-grayscale14));
    --fill-helptext: light-dark(var(--c-oceanblue06), var(--c-dark-purple));
    --fill-pubid:    light-dark(hsl(60 100% 86.7%), hsl(276 100% 50%));

    --fill-pubid-border:   light-dark(hsl(56 100% 50%), var(--c-grayscale15));
    --fill-annotation:     light-dark(var(--c-blue01), var(--c-blue03));
    --fill-on-highlight01: light-dark(var(--c-grayscale03), var(--c-grayscale14));
    --fill-on-highlight02: light-dark(var(--c-grayscale04), var(--c-grayscale13));
    --fill-actions01:      light-dark(var(--c-grayscale02), var(--c-grayscale16));
    --fill-actions02:      light-dark(var(--c-grayscale06), var(--c-grayscale14));
    --fill-actions03:      light-dark(var(--c-grayscale93), var(--c-grayscale14));

    --fill-chart-gridline01: light-dark(var(--c-grayscale04), var(--c-grayscale12));
    --fill-chart-gridline02: light-dark(var(--c-grayscale07), var(--c-grayscale09));
    --fill-chart-label02:    var(--c-grayscale08);
    --fill-tile-placeholder: light-dark(var(--c-grayscale02), var(--c-grayscale13));
    --fill-stacks-highlight: light-dark(var(--c-grayscale06), var(--c-grayscale12));
    --fill-stacks-pill:      light-dark(var(--c-grayscale07), var(--c-grayscale11));

    --fill-dropdown-indication: light-dark(var(--c-grayscale07), var(--c-grayscale08));
    --fill-active-filters:      var(--text);

    --fill-delete:            light-dark(var(--c-crimson01), var(--c-crimson02));
    --fill-delete-border:     light-dark(var(--c-crimson02), var(--c-crimson01));
    --fill-delete-background: light-dark(var(--c-crimson02), transparent);

    --fill-edit-icon:       light-dark(var(--c-grayscale03), var(--c-grayscale14));
    --fill-edit-icon-hover: light-dark(var(--c-grayscale06), var(--c-grayscale09));
    --fill-admin-active:    light-dark(var(--c-grayscale04), var(--c-grayscale13));

    --fill-inflow:  var(--c-oceanblue04);
    --fill-outflow: var(--c-red);

    --fill-popover: var(--fill-helptext);
    --text-popover: var(--text);
    --fill-btn-popover: var(--text);
    --text-btn-popover: var(--fill-helptext);

    --fill-changelog-active:        light-dark(var(--fill-actions02), var(--fill-tile));
    --fill-changelog-active-border: light-dark(var(--fill-actions02), var(--c-blue02));

    --fill-sorter: light-dark(hsl(0 0% 72%), var(--c-grayscale08));

    --fill-mismatch-marker: light-dark(hsl(196 96% 92%), hsl(196 96% 20%));
    --fill-missing-value:   light-dark(var(--c-grayscale04), var(--c-grayscale12));
    --fill-timeline-markup: light-dark(hsl(232 84% 94%), var(--c-grayscale11));

    --fill-droptarget: light-dark(var(--c-violet01), var(--c-violet01));

    --fill-outline:       light-dark(var(--c-grayscale06), var(--c-grayscale08));
    --fill-tile-shadow:   hsl(0 0% 30% / 0.2);
    --border-sticky-head: light-dark(var(--c-grayscale07), var(--c-grayscale09));

    --text-defunct:       light-dark(var(--c-blue01), var(--c-blue03));
    --text-disabled:      light-dark(hsl(0 0% 0% / 0.16), var(--c-grayscale09));
    --text-link:          light-dark(var(--c-blue01), var(--c-blue03));
    --text-link-visited:  light-dark(hsl(232 48.8% 39.8%), var(--c-blue04));
    --text-pill:          var(--text);
    --text-toggle-active: light-dark(var(--c-grayscale01), var(--c-grayscale15));
    --text:               light-dark(var(--c-grayscale14), var(--c-grayscale07));

    --shadow-scroll:    light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.25));
    --gradient-shadow:  linear-gradient(to right, rgb(0 0 0 / 0.1) 0%, rgb(0 0 0 / 0) 100%);
    --gradient-account: linear-gradient(90deg, #c42d53 0%, #941b80 100%);
    --gradient-spinner: linear-gradient(to bottom, hsl(0 0% 96% / 1) 12%, hsl(0 0% 96% / 0) 100%);

    --img-logo:     url("logo-black.08759be575ff.svg");
    --stroke-input: light-dark(hsl(0 0% 80%), var(--c-grayscale09));

    --fill-message-btn: var(--fill-button);
    --text-message-btn: var(--text);
    --text-message-btn-warning: light-dark(var(--c-grayscale01), var(--c-grayscale07));

    /* Assigned in the svg */
    --fill-svg-layer1: var(--text);
    --fill-svg-layer2: var(--c-grayscale01);
    /* --- */

    --fill-mask-icon: var(--text);
    --gradient-icon-stop-1: #d50951;
    --gradient-icon-stop-2: #931c80;
    --gradient-icon-stop-3: #f8b032;
    --gradient-icon-1: linear-gradient(45deg, var(--gradient-icon-stop-1) 32%, var(--gradient-icon-stop-2) 72%);
    --gradient-icon-2: linear-gradient(45deg, var(--gradient-icon-stop-3) 0%, var(--gradient-icon-stop-1) 72%);
    --gradient-icon-3: linear-gradient(45deg, var(--gradient-icon-stop-2) 22%, var(--gradient-icon-stop-3) 70%);
    --gradient-icon-4: linear-gradient(45deg, #009afc 10%, var(--gradient-icon-stop-2) 90%);
    --spinner: var(--c-grayscale14);
    --icon-spinner: url("icon-spinner.c5776c15a718.svg");
    /* ======================================== */

    --font-family-sans: "Public Sans", sans-serif;
    --font-family-mono: "Source Code Pro", monospace;
    --fsize:         1.6rem;
    --fsize-small:   1.2rem;
    --fsize-columns: 1.14rem;
    --fsize-field:   1.4rem;
    --fsize-mono:    1.1rem;
    --fsize-total:   4rem;

    --weight-thin:       300;
    --weight-normal:     400;
    --weight-light-bold: 500;
    --weight-semi-bold:  600;
    --weight-bold:       700;

    --height-btn: 3.4rem;
    --mask-size:  4rem;
    --pad-view:   4rem;
    --pad-hor:    4rem;

    --pad-left:       10.8rem;
    --pad-right:      4rem;
    --pad-bottom:     2.8rem;
    --pad-vert:       3.2rem;
    --pad-vert-small: 1.6rem;

    --w-column-tools:   24vw;
    --fill-zebra:       light-dark(var(--c-grayscale02), var(--c-grayscale14));
    --fill-zebra-table: light-dark(var(--c-grayscale03), var(--c-grayscale14));

    --fill-button-scroll:   light-dark(hsl(0 0% 80% / 0.2), hsl(0 0% 50% / .4));
    --scroller-height:      22rem;
    --scroller-height-mask: 1.8rem;

    --w-btn:    var(--height-btn);
    --w-sticky: var(--pad-left); /* checkbox-column width */
    --w-bumper: 0.4rem;

    /* Control over the form field width; See two-column and label-above-widget
     * layouts (for example the login page).
     */
    --w-field: 30rem;

    /* Copy to clipboard colors */
    --c2c-fill:    light-dark(var(--c-grayscale05), var(--c-grayscale10));
    --c2c-text:    light-dark(var(--c-blue01), var(--c-grayscale07));
    --extapi-fill: light-dark(var(--c-grayscale06), var(--c-grayscale08));

    --width-nav-icon: 4.8rem;

    @media screen and (width <= 600px) {
        --pad-hor: 1.6rem;
    }
}


* { box-sizing: border-box; }

html {
    min-height: 100vh;
    width: 100%;
    font-family: var(--font-family-sans);
    font-size: 62.5%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--fill-body);
    color: var(--text);

    &.drop-active::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 99;
        background-color: var(--fill-droptarget);
        opacity: 0.32;
    }
}

body {
    /* To make the footer stick at the bottom of the page: */
    display: flex;
    flex-direction: column;
    /* ------ */

    min-height: 100vh;
    margin: 0;
    font-size: 1.4rem;
    font-weight: var(--weight-normal);

    /* Only make the modal scrollable when active */
    &.modal-active { overflow: hidden; }
}

h1 {
    margin: 0;
    font-size: 2.4rem;
    font-weight: var(--weight-light-bold);

    .column-tools & {
        font-size: 1.6rem;
        font-weight: bold;
    }
}

h2,
h3 {
    margin: 3rem 0 1rem;
    font-size: var(--fsize);
    font-weight: var(--weight-light-bold);

    .column-tools & {
        --fsize: 1.4rem;
        --weight-light-bold: 400;

        margin: 2rem 0 0.8rem;
    }
}

h4,
h5,
h6 {
    margin: 0;
    font-size: var(--fsize);
    font-weight: var(--weight-light-bold);
}


th {
    text-align: left;   /* "reset css" */
    font-weight: var(--weight-semi-bold);   /* slightly thinner than bold, closer to the headings */
}

th[align="right"] {
    text-align: right; /* because I just "reset" the default. */
}

a {
    text-decoration: none;
    color: var(--text-link);

    /* See template unlinkview filter: disable an A HREF: */
    &[href^='#unlinked-view'] {
        text-decoration: inherit;
        color: inherit;
        cursor: text;  /* most likely contains text. */
    }

    .text-link-visited &:visited {
        /* Explicitly added to list views where we feel it works; On short list
         * views such as Administration or Local MSP IDs you will have nothing
         * but purple links in no time: this is not helpful and does not look
         * good.
         */
        color: var(--text-link-visited);
    }
}

b,
strong {
    font-weight: var(--weight-semi-bold);
}

small {
    /* must scale depending on its ancestor: */
    font-size: smaller;
}

hr {
    background-color: var(--fill-separator-on-tile);
    padding: 0;
    margin: 2.4rem 0;
    height: 1px;
    border: none;

    .column-tools & {
        margin: 2.4rem -4rem 2.4rem -3.4rem;
    }
}

blockquote {
    font-size: 3.2rem;
    color: var(--c-blue01);
}


table {
    /* set for all tables */
    border-collapse: collapse;
}


code {
    font-family: var(--font-family-mono);
}


pre {
    font-family: var(--font-family-mono);
    font-size: var(--fsize-mono);
    font-weight: var(--weight-normal);

    margin: 0;

    &.script-content {
        overflow-x: auto;
        width: 60em;
    }
}

svg {
    display: inline-block;
    vertical-align: middle;

    .loading-dot { fill: var(--fill-loader); }

    .area-step-0 { fill: var(--fill-step-0); }
    .area-step-1 { fill: var(--fill-step-1); }
    .area-step-2 { fill: var(--fill-step-2); }
    .area-step-3 { fill: var(--fill-step-3); }
    .area-step-4 { fill: var(--fill-step-4); }
    .area-step-5 { fill: var(--fill-step-5); }
    .area-step-6 { fill: var(--fill-step-6); }
    .area-step-7 { fill: var(--fill-step-7); }
    .area-step-8 { fill: var(--fill-step-8); }
    .area-step-9 { fill: var(--fill-step-9); }
    .area-success { fill: var(--c-turquoise03); }
    .area-error   { fill: var(--c-red); }

    /* Claimed for purchase/sales prices
     * Same for light/dark mode
     */
    .line-step-0 {
        stroke: var(--c-carmine);
        stroke-dasharray: 5,2;
    }

    .line-step-1 {
        stroke: var(--c-blue01);
    }

    .circle-step-1 {
        fill: var(--c-blue01);
    }

    .circle-step-0 {
        fill: var(--c-carmine);
    }
    .stack-inflow {
        fill: var(--fill-inflow);
    }
    .stack-outflow {
        fill: var(--fill-outflow);
    }
}

/* css mask icons */
.icon-chargecard  { mask-image: url("icon-chargecard.36ba72f040dd.svg"); }
.icon-chargepoint { mask-image: url("icon-chargepoint.c69d006f50a8.svg"); }
.icon-tasks       { mask-image: url("icon-tasks.f29cc0c6586c.svg"); }
.icon-review-sets { mask-image: url("icon-review-sets.8d6e7b2fcda2.svg"); }
.icon-invalid     { mask-image: url("icon-invalid.7f2749d8184c.svg"); }

.icon-active-sessions   { mask-image: url("icon-active-sessions.7539e9a92834.svg"); }
.icon-bad-connection    { mask-image: url("icon-bad-connection.1ad17766c136.svg"); }
.icon-cpo-invoice-check { mask-image: url("icon-cpo-invoice-check.c15ee46c52dc.svg"); }
.icon-possible-fraud    { mask-image: url("icon-possible-fraud.f3d877202fe5.svg"); }

.mask-icon {
    display: block;
    flex-shrink: 0;
    width: var(--mask-size);
    height: var(--mask-size);
    background: var(--fill-mask-icon);
    mask-size: var(--mask-size);
}
/* ---- */

header.header1 {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 0;
    min-height: 3.2rem;
    padding: 2rem var(--pad-hor) 1.6rem var(--pad-left);
    background-color: var(--fill-body);

    -webkit-user-select: none;
    user-select: none;

    a {
        text-decoration: none;
        color: var(--text);

        &:hover,
        &.active {
            --fill-svg-layer1: var(--text-link);

            color: var(--text-link);
        }
    }

    .header-left { position: relative; }
}

.header1-column-right {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    margin-left: auto;
    right: var(--pad-hor);

    /* nav-admin has a variable width. But because it is an anchor we
     * can use its' width to set the correct size for the popover
     */
    &:has(.toggle-admin) {
        .search-popover:popover-open {
            width: calc(anchor-size(--shortcut-form width) + anchor-size(--nav-admin width));
            max-width: 32rem;
        }
    }

    &:has(.admin-nav:popover-open) {
        .toggle-admin svg { transform: rotate(-180deg); }
    }
}

button.toggle-admin {
    --fill-svg-layer1: var(--text);

    anchor-name: --nav-admin;
}

.admin-nav {
    display: none;
    position-anchor: --nav-admin;
    top: calc(anchor(top) + 3.2rem);
    position-area: block-end;
    right: var(--pad-hor);
    padding: 0;

    &:popover-open {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        margin: 0;
        border-radius: 0.8rem;
        overflow: hidden;
        background-color: var(--fill-tile);
        box-shadow: 0 1.2rem 1.2rem 0 var(--fill-nav-shadow);
        border: none;
    }

    form {
        display: flex;
        flex-direction: column;
        min-width: 20rem;
        padding-block: 0 0.8rem;
        border-bottom: 0.1rem solid var(--fill-separator-on-body);

        &:last-child { border: none; }
    }

    button,
    a div {
        text-align: left;
        padding: 0.6rem 2rem;
        cursor: pointer;
        background-color: transparent;
        color: var(--text);
        font-size: 1.4rem;

        &:hover { color: var(--text-link); }

        &.active { background-color: var(--fill-admin-active); }
    }

    .btn { margin: 0 2rem 2rem; }
}

/* make the button 'pop out' on the overlay when popover is visible */
body:has(.admin-nav:popover-open) {
    .nav-dropdown-overlay { opacity: 0.5;}

    .popover-header-overlay {
        position: absolute;
        opacity: 0.5;
    }

    .header1-column-right { z-index: 1; }
    .shortcut-form        { opacity: .3; } /* faking overlay */
}

.header-logo {
    position: absolute;
    top: -0.3rem;
    left: -8rem;

    img {
        width: 6.4rem;
        height: 3.2rem;
        margin: 0;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    margin: 0.4rem 0;
    font-weight: bold;
    font-size: 1.4rem;
    text-transform: none;
    margin-left: 2.4rem;

    &:hover {
        color: var(--text-link);
    }

    svg {
        --fill-svg-layer1: var(--text);

        width: 3.2rem;
        height: 3.2rem;
        margin-right: 0.8rem;
    }

    &:hover svg { --fill-svg-layer1: var(--text-link); }
}



/* Curtain navigation dropdown
   --------------------------- */

.nav-menubar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    margin-right: 2.4rem;
    align-items: center;
}

.nav-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    right: 0;

    &.hide-menu {
        grid-template-rows: 0fr;

        .nav-animation-wrapper nav { display: none; }
    }
}

.nav-menuitem {
    cursor: pointer;
    padding-block: 0.4rem;
    display: flex;
    gap: 0.4rem;
    align-items: center;

    input {
        position: absolute;
        top: 0;
        clip-path: circle(0);
    }

    svg {
        width: 1.4rem;
        height: 1.4rem;
        display: block;
        border-radius: 0.8rem;
        transform: rotate(0);
        transition: transform 0.32s ease-in-out, background-color 0.32s ease-in-out;
    }

    &:has(input:checked) svg {
        transform: rotate(-180deg);
        background-color: var(--fill-stacks-pill);
    }

    &:has(input[type="checkbox"]:focus-visible) {
        outline: var(--text) dotted 0.1rem;
        outline-offset: 0.2rem;

        svg { outline: unset; }
    }

    /* this is to push the stacks-pill to the right, and it still wil work
     * with wrapping.
     */
    &:nth-last-child(2) { margin-right: 0.8rem; }

    &.stacks-pill {
        --fill-svg-layer1: var(--text);

        border-radius: 4rem;
        height: 2.2rem;
        font-size: var(--fsize-small);
        padding: 0 0.6rem 0 0;
        background-color: var(--fill-stacks-pill);
        color: var(--text);
        border-bottom: none;

        &.no-current-stack {
            padding-left: 1.2rem;
        }

        &:has(input:checked)::after { bottom: -2.4rem; }

        div {
            max-width: 24rem;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
    }

    &.current-collection {
        outline: 0.2rem solid var(--fill-dropdown-indication);
        border-radius: 0.3rem;
        padding-inline: 0.9rem 0.5rem;
    }
}

.nav-browse-stack-flag {
    display:flex;
    align-items: center;
    justify-content: center;
    height: 2.2rem;
    width: 2.2rem;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: var(--c-grayscale08);
    color: var(--c-grayscale01);

    .nav-browse-stacks-row & {
        position: absolute;
        top: 1rem;
        left: 7.2rem;
    }

    &.color-stack00 { background-color: var(--c-deeppink); }
    &.color-stack01 { background-color: var(--c-green); }
    &.color-stack02 { background-color: var(--c-orange); }
    &.color-stack03 { background-color: var(--c-blue01); }
    &.color-stack04 { background-color: var(--c-red); }
    &.color-stack05 { background-color: var(--c-eggplant); }
    &.color-stack06 { background-color: var(--c-purple); }
    &.color-stack07 { background-color: var(--c-caramel); }
    &.color-stack08 { background-color: var(--c-carmine); }
}

.active .is-favorite,
.interactive-form .is-favorite,
.active .nav-browse-stack-flag,
.nav-menuitem.new-stack .nav-browse-stack-flag {
    animation-duration: 0.4s;
    animation-timing-function: ease-out;
    animation-delay: 0s;
    animation-iteration-count: 1;
    animation-name: Blink;
}

.popover-header-overlay,
.nav-dropdown-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-color: var(--fill-overlay);
    opacity: 0;
}

.nav-dropdown-overlay {
    body:has(.nav-menuitem input:checked) & {
        opacity: 0.5;
        pointer-events: auto;
    }
}

.nav-animation-wrapper {
    overflow-x: auto;
    padding-block: 3.6rem 4.8rem;
    transform: translateY(0);
    background-color: var(--fill-body);
    box-shadow: 0 1.2rem 1.2rem 0 var(--fill-nav-shadow);

    .nav-dropdown.hide-menu & {
        padding-block: 0;
        transform: translateY(-1.2rem);
    }

    nav {
        display: flex;
        padding: 0 var(--w-sticky);
        gap: 6.4rem;

        &.no-grid {
            display: block;
            padding-inline: 0;
        }

    }
}

.nav-browse-stacks,
.list-stacks {
    display: grid;
    grid-template-columns: auto auto 1fr;
    border-top: 0.1rem solid var(--fill-separator-on-body);

    font-size: var(--fsize-columns);
    line-height: 1.6rem;
}

.list-stacks {
    border-top: 0.1rem solid var(--fill-body);
    padding-bottom: var(--pad-vert);
}

.nav-browse-stacks-row {
    display: contents;

    > div {
        white-space: nowrap;
        border-bottom: 0.1rem solid var(--fill-separator-on-body);

        > div > *:first-child { font-weight: bold; }

        .anim-stack-column-row {
            min-height: 0rem;
            padding: 1.2rem 1.6rem;

            &:first-child { padding-left: 0; }
        }
    }

    > *:first-child {
        position: relative;
        padding-left: var(--pad-left);
    }

    &.active > * {
        background-color: var(--fill-stacks-highlight);
        border-top: none;
    }

    &:first-child > div,
    &.active + div > div {
        border-top: none;
    }
}

.nav-browse-is-favorite { border-top: 0.1rem solid var(--fill-body); }

.list-stacks {

    .nav-browse-stacks {
        border-bottom: 0.1rem solid var(--fill-body);
    }

    .nav-browse-stacks-row {

        > div {
            --fill-separator-on-body: var(--fill-body);

            display: grid;
            grid-template-rows: 1fr;
            overflow: hidden;
            transition: grid-template-rows 0.16s ease-out;
        }

        > *:first-child { padding-left: var(--pad-left); }

        a {
            --text-link: var(--text);

            &:hover { --text-link: var(--c-blue01); }
        }

        &.stack-removed {

            > div {
                grid-template-rows: 0fr;
                border-bottom: none;

                .anim-stack-column-row { padding-block: 0; }
            }
        }
    }
}

.list-stack-actions {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 0.1rem solid var(--fill-body);
    font-size: var(--fsize-columns);

    .nav-animation-wrapper & {
        border-top-color: var(--fill-separator-on-body);
    }

    .btn.icon-left {
        cursor: pointer;
        padding-right: 0.4rem;
    }

    .icon-favorite,
    .icon-trash {
        width: 1.6rem;
        height: 1.6rem;
    }

    > form { display: inline-flex; }
}

.nav-browse-stacks-helptext {
    --fill-helptext: var(--fill-pill-on-body);

    margin-left: 11rem;
}

.nav-all-stacks {
    padding-top: 1.8rem;
    padding-left: var(--pad-left);

    .pill {
        display: inline-flex;
        padding: 0.6rem 0.6rem 0.6rem 1.2rem;

        svg {
            width: 1.4rem;
            height: 1.4rem;
            margin-inline: 0.2rem 0;
        }
    }
}

.nav-column .nav-toc:first-child { padding-top: var(--mask-size); }

.nav-toc-heading {
    display: flex;
    color: var(--text);
    font-weight: bold;
    min-height: var(--mask-size);
    border-bottom: 0.1rem solid var(--fill-separator-on-body);

    /* Always keep the description in 2nd column */
    > span:last-child { grid-column: 2; }
}

.nav-toc {
     list-style-type: none;
     margin: 0.8rem 0 0;
     padding: 0 2.4rem 0 0;

     li {
        display: flex;
        gap: 0.8rem;
        padding-block: 0.8rem;

        /* Add extra separator top margin on the first .specialist item */
        &:not(.specialist) + li.specialist { margin-top: 1.4rem; }

        &.specialist {
            padding-block: 0.4rem;

            a.nav-label { min-height: 1.5rem; }
        }

        a.nav-label {
            min-height: 1.8rem;

            &.current-collection { font-weight: var(--weight-bold); }
        }
    }
}

.nav-toc-icon {
    --mask-size: 2.6rem;

    flex-shrink: 0;
    margin-right: 0.6rem;
    transform: translateY(-0.4rem);
}

.specialist {
    font-size: var(--fsize-small);
}

/* --------------- */


span.needs-attention-counter {
    display: block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 0.3rem;
    background-color: var(--fill-pill-active);
    margin-top: 0.1rem;
    animation: heartbeat-2 1.2s ease-in-out 2 both;
}

a.other-side {
    display: inline-flex;

    span.needs-attention-counter {
        animation-iteration-count: infinite;
    }
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 7.2rem;
    margin-top: auto; /* push footer to bottom */
    padding-left: var(--pad-hor);
    padding-right: var(--pad-hor);
    color: var(--text);
    font-size: 1.1rem;

    -webkit-user-select: none;
    user-select: none;

    a {
        color: inherit;
        text-decoration: none;
        text-transform: uppercase;
    }

    .separator::before {
        content: "-";
        display: inline-block;
        margin-left: 0.8rem;
        margin-right: 0.8rem;
    }

    .footer-left { margin-right: auto; }
}

.tdc-logo {
    display: block;
    height: 4.8rem;
    width: 9.6rem;
    margin-left: 3.2rem;
    background: var(--img-logo) no-repeat;
    text-indent: -200px;
    overflow: hidden;
}


main {
    width: 100%; /* Needed for various max-width's to work */
    margin: 0;
    background-color: var(--fill-tile);
    position: relative;

    &.loginview {
        margin-left: auto;
        margin-right: auto;
        padding-bottom: var(--pad-vert);

        > * {
            padding-inline: var(--pad-right);
        }

        .masthead { display: block; }

        .message {
            --pad-left: 4rem;
            --pad-hor: 4rem;

            padding-left: 4rem;
        }
    }

    &.formview div.masthead {

        /* formview.html has a textarea which is wider than the current max
         *  width on formview. Set desired width:
         */
        &.script {
            --w-field: 56rem;
            /* would be nice if this variable could use --w-field, but safari
             * does not support that.
             */
            --grid-form-two-columns: 16rem 56rem;
        }

        &.purchase-invoices {
            --w-field: 56rem; /* needed because search field places checkbox "relative"... */
            --grid-form-two-columns: 16rem 60rem;
        }

        .formview-actions {
            grid-column: 1;
            grid-row: 2;
            padding-block: 2.4rem;
            border-top: 0.1rem solid var(--fill-outline);
        }

        .formview-description { margin: 0 0 1em 0; }
    }

    &.loginview {
        --w-field: 38rem;

        max-width: calc(var(--w-field) + 8rem);
        margin-top: 5.2rem;

        .message-container + & {
            margin-top: 0;
        }
    }

    &.listview {
        .list-movers {
            padding: 1.2rem var(--pad-right) 1.2rem calc(var(--pad-left) - 1.4rem);
            border-top: 0.1rem solid var(--fill-body);

            .filter-actions {
                margin: 0;
                display: flex;
                flex-wrap: wrap;
                gap: 0.4rem;

                .pill {
                    background-color: var(--fill-pill-on-tile);
                }
            }
        }

        .info-text {
            margin: 1.6rem var(--pad-hor) 1.6rem 7rem;
            font-style: italic;
        }
    }

    &.errorpage {
        min-height: calc(100vh - 20rem);
        max-width: 80rem;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background-color: transparent;
        text-align: center;
    }

    > :first-child { margin-top: 0; }

    > :last-child { margin-bottom: 0; }

    .pill,
    .pill-searchbox {
        background-color: var(--fill-pill-on-tile);
    }
}

.global-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: absolute;
    top: 1.6rem;
    right: 1.6rem;

    .changelog-link,
    button.delete-item {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 3.4rem;
        height: 3.4rem;
        border-radius: 0.4rem;
    }

    svg {
        width: 2rem;
        height: 2rem;
        fill: var(--text);
    }

    .changelog-link {
        background-color: var(--fill-tile);
        border: 0.1rem solid var(--fill-field-border);
        fill: var(--text);

        svg { fill: var(--text); }

        .changelog & {
            border: 0.1rem solid var(--fill-changelog-active-border);
            background-color: var(--fill-changelog-active);
        }
    }

    .delete-item {
        background-color: var(--fill-delete-background);
        border: 0.1rem solid var(--fill-delete-border);

        svg { --fill-svg-layer1: var(--fill-delete); }
    }
}

.thin { font-weight: var(--weight-thin); }


.oneword {
    /* See toolkit: for session id's and the like. */
    -webkit-user-select: all;
    -moz-user-select: all;
    user-select: all;
}


.pubid-position {
    /* pubid tool, see common-components.js */
    position: relative;
    height: 0;
    width: 0;
    display: inline; /* fix positioning in td align=right cells. */

    .pubid-overlay {
        position: absolute;
        left: 0;
        font-family: var(--font-family-mono);
        font-size: var(--fsize-small);
        font-weight: 400;
        white-space: nowrap;
        background-color: var(--fill-pubid);
        border: 0.1rem solid var(--fill-pubid-border);
        border-radius:0.2rem;
        padding-right: 0.4rem;
        visibility: hidden;
        display: flex;
    }

    .column-icon & .pubid-overlay { top: -0.9rem; }

    .pubid-button {
        --mask-size: 1.6rem;

        display: block;
        width: var(--mask-size);
        height: var(--mask-size);
        margin: 0 0.2rem;
        background-color: var(--text);
        mask-image: url("icon-copy.d10a0bfbd382.svg");
        mask-size: var(--mask-size);

        &:hover { transform: scale(1.12); }
    }
}

    .pubid-view-active .pubid-position .pubid-overlay {
        /* Toggle this class to show all pub id overlays. */
        visibility: visible;
    }


.evselocationid-text,
.evseid-text,
.multi-title {
    /* Either one of our #000001 generated ids or an external reference,
     * for example a UUID like d5738bf7-a6e2-4df7-9406-aa5dc654c627. These
     * words _might_ claim much more cell width then they end up using, due
     * to word wrapping. See screenshot in TD-507 for an example.
     */
    word-break: break-all;
}

/* =======
   BUTTONS
   ======= */
/* iOS override; */
[type="reset"],
[type="submit"] {
    -webkit-appearance: none;
    appearance: none;
}

[type="reset"],
[type="submit"],
button {
    border: none;
    font-family: var(--font-family-sans);
}


.btn {
    height: var(--height-btn);
    margin: 0.2rem 0.4rem 0.2rem 0;
    padding: 0.6rem 1.4rem;
    font-family: var(--font-family-sans);
    font-size: 1.3rem;
    font-weight: var(--weight-normal);
    color: var(--text);
    background-color: var(--fill-button);
    border-radius: 0.4rem;
    white-space: nowrap; /* Don't wrap btn text */
    cursor: pointer;

    svg {
        margin-left: 0.9rem;
        margin-right: 0.9rem;
        width: 1.6rem;
    }

    .column-actions &.primary,
    &.primary {
        background-color: var(--c-green);
        color: var(--c-grayscale01);
        --fill-svg-layer1: var(--c-grayscale01);
    }

    &.suggestion {
        background-color: var(--fill-pill-active);
        color: var(--c-grayscale01);
        --fill-svg-layer1: var(--c-grayscale01);
    }

    &[disabled],
    &.inactive {
        background-color: var(--fill-activity-disabled);
        color: var(--text-disabled);
        --fill-svg-layer1: var(--text-disabled);
    }

    .column-actions & { background-color: var(--fill-actions02); }

    &.active { background-color: var(--fill-actions02); }

    .large & {
        border-radius: 0.5rem;
        --height-btn: 4.6rem;

        padding: 1.4rem 2.4rem;
        font-size: 1.5rem;
    }

    &.clean {
        /*
         * See rate remove on the rates view, or search box loupe icon
         */
        border-radius: 0;
        background-color: transparent;
        color: var(--text);
        --fill-svg-layer1: var(--text);
        --height-btn: auto;

        padding: 0;
        margin: 0;
        border-bottom: none;

        svg {
            /* See above, unset the margins again */
            margin: 0;
        }
    }

    &:is(.icon, .icon-left, .icon-right) > span {
        display: flex;
        align-items: center;
        height: inherit;
    }

    &.icon-right {
        padding: 0 0 0 1.4rem;

        &.large { padding: 0 0.4rem 0 1.6rem; }

        svg     { margin-left: 0.2rem; }
    }

    &.icon-left {
        padding: 0 1.6rem 0 0;

        &.large { padding: 0 1.6rem 0 0.4rem; }

        svg     { margin-right: 0.2rem; }
    }

    &.icon {
        padding: 0;
        width: var(--w-btn);

        .large & { --w-btn: 4.6rem; }
    }

    .icon-open-dialog {
        width: 1rem;
        height: 1rem;
    }

    &.spacer-left { margin-left: 0.4rem; }
}


a.btn {
    display: inline-block;
    padding: 0.9rem 1.4rem;
    /* This is just here to visual align the button with the text alongside it,
       i.e. valign middle; But the svg element inside the .btn is still lower
       (and does not have a valign): */
    vertical-align: top;
    text-decoration: none;
}

svg.icon-favorite {
    --fill-svg-layer1: hsl(0 0% 85.1%);
    --fill-svg-layer2: var(--fill-tile);

    &.is-favorite {
        --fill-svg-layer1: transparent;
        --fill-svg-layer2: hsl(350 78.6% 54.1%);
    }
}

/* ===============
 * DJANGO MESSAGES
 * ===============
 */
.message-container {

    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background-color: var(--fill-tile);

    .message {
        width: 100%;
        margin-inline: 0;
    }

    &.loginview {
        margin: 0 auto;
        max-width: calc(38rem + 8rem);
        width: 100%;

        .message { padding-left: 3.2rem; }
    }
}

.posting,
.frontend-message,
.message {
    --fill-svg-layer1: var(--text);

    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: var(--weight-light-bold);
    padding: 0.8rem 1.6rem;
    color: var(--text);

    /* negative margin to the left based on variable --pad-left
       negative margin to the right of var(--pad-hor) (this is the gap of the masthead grid). */
    width: calc(100% + var(--pad-left) + var(--pad-hor));
    margin-left: calc(var(--pad-left) * -1);
    margin-right: -2.4rem;
    padding-left: calc(var(--pad-left) - 3.6rem);

    a {
        color: var(--text);
        text-decoration: underline;
    }

    &.success {
        background-color: var(--fill-highlight-success);

        .message-icon { --fill-svg-layer1: var(--c-parakeet01); }

        @media (prefers-color-scheme: dark) { border-bottom: 0.2rem solid var(--c-parakeet01); }
    }

    &.processing {
        --fill-message-btn: var(--fill-btn-processing);

        background-color: var(--fill-highlight-processing);
    }

    &.info {
        background-color: var(--fill-highlight-info);

        .message-icon { --fill-svg-layer1: var(--c-cobalt01); }

        @media (prefers-color-scheme: dark) { border-bottom: 0.2rem solid var(--c-cobalt01); }
    }

    &.error {
        background-color: var(--fill-highlight-error);

        .message-icon { --fill-svg-layer1: var(--c-crimson01); }

        @media (prefers-color-scheme: dark) { border-bottom: 0.2rem solid var(--c-crimson01); }
    }

    &.warning {
        --fill-message-btn: var(--fill-btn-warning);
        --text-message-btn: var(--text-message-btn-warning);

        background-color: var(--fill-highlight-warning);

        .message-icon { --fill-svg-layer1: var(--c-tangerine01); }

        @media (prefers-color-scheme: dark) { border-bottom: 0.2rem solid var(--c-tangerine01); }
    }

    .message-icon svg {
        width: 3.2rem;
        height: 3.2rem;
        transform: translateX(-0.6rem);
    }

    .message-btn {
        background-color: var(--fill-message-btn);
        color: var(--text-message-btn);
        text-decoration: none;
        margin: 0 0.4rem;
    }
}

.frontend-messages {
    --w-bumper: 0;

    position: sticky;
    top: 0;

    .frontend-message {
        margin-inline: 0;
        padding-left: 1.6rem;
        width: 100%;
    }
}

/* ===========
 * FORM FIELDS
 * ===========
 */

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea {
    /* iOS override */
    -webkit-appearance: none;
    appearance: none;
    /* ---------- */
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
input[type="date"],
input[type="datetime"],
input[type="datetime-local"] {
    padding: 0.6rem 1.2rem;
    font-family: var(--font-family-sans);
    font-size: var(--fsize-field);
    color: var(--text);
    background-color: var(--fill-field);
    border: 1px solid var(--fill-field-border);
    border-radius: 0.4rem;
}

/* Use browser default size for date types */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea {
    width: var(--w-field);
}


textarea {
    /* Initially use 100% on textarea, unless cols attribute is set: */
    &:not([cols]) {
        width: 100%;
    }

    &.script-content {
        font-family: var(--font-family-mono);
        font-size: 1.4rem;
        overflow: auto;
        white-space: pre;
        width: 100%;
        min-height: 50vh;
    }
}


input[type="date"],
input[type="datetime"],
input[type="datetime-local"] {
    /* Not setting the width, keep it at default "fix to content", unless: */
    padding-right: 0.4rem;

    .modal-content & {
        margin-bottom: 0.8rem;
        width: 100%;
    }

    + & { margin-left: 0.8rem; } /* space between two fields (filtering) */
}

input[type="number"],
input[type="text"][data-type="decimal"] {
    text-align: right;
    -moz-appearance: textfield;

    &::-webkit-inner-spin-button,
    &::-webkit-outer-spin-button {
        -webkit-appearance: none;
    }
}

/* override Safari, we have our own icons */
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-cancel-button {
    display: none;
}
/* ------ */

/* Set "key icon" position for password field in iOS */
input::-webkit-credentials-auto-fill-button {
    transform: translateX(1.2rem);
}

.token-readonly input[readonly] {
    background: transparent;
    border: none;
}

/* Custom selectbox */
select {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    padding: 0.6rem 2.8rem 0.6rem 1.2rem;
    font-family: var(--font-family-sans);
    font-size: var(--fsize-field);
    color: var(--text);
    background-color: var(--fill-field);
    border: 1px solid var(--fill-field-border);
    border-radius: 0.4rem;
}

.pioneer-selectbox {
    position: relative;
    display: block;
    max-width: var(--w-field);

    &::after {
        --mask-size: 1.6rem;

        position: absolute;
        right: 0.8rem;
        top: 0.8rem;
        display: block;
        content: "";
        width: var(--mask-size);
        height: var(--mask-size);
        background-color: var(--text);
        pointer-events: none;
        mask-image: url("icon-chevron-down.23f28a4e8a2e.svg");
        mask-size: var(--mask-size);
    }

    select { overflow: hidden; } /* workaround for Safari overflow bug */
}

/* --------- */

/* dotted border outline on custom svg inputs: */
:is(input[type="checkbox"],
    input[type="radio"]):focus-visible + svg {
    outline: var(--text) dotted 0.1rem;
    outline-offset: 0.2rem;
}


/* Most browsers don't allow custom styling on file input. A workaround is
 * to style a label as a button, and point it to the "hidden" file input:
 * <input type="file" class="hide-file-input" id="file">
 * <label for="file">Import file<label>
 */
.hide-file-input {
    position: absolute;
    transform: scale(0);

    /* Give label the focus look when using keyboard */
    &:focus-visible + label {
        outline: 0.4rem auto Highlight; /* Firefox */
        outline: 0.4rem auto -webkit-focus-ring-color; /* Chrome, Safari */
    }

    + label {
        padding: 0.9rem 1.4rem;
        display: block;
    }
}

.pioneer-formfield {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;

    select { width: var(--w-field); }
}

.kajuit-checkbox-widget,
.pioneer-label {
    font-weight: var(--weight-light-bold);
    /* Slightly less weight than a heading. See also th weights */
}

.pioneer-field {
    display: flex;
    flex-direction: column;
    margin: 0.6rem 0;

    .pioneer-help-text {
        order: 2;
        margin-top: 0.4rem;
        font-size: 95%;
        font-style: italic;
        width: var(--w-field);
    }

    &.column-field {
        --w-field: 100%;

        overflow: auto visible;
        width: 100%;

        select,
        .pioneer-selectbox,
        .column-cell-value {
            min-width: 12rem;
        }

        .pioneer-field,
        .column-cell-value {
            padding-inline: 0 0.4rem;
        }

        .column-cell-value {
            width: var(--w-field);
            white-space: nowrap;
            overflow: clip;
            height: 1em;
            line-height: 100%;
            text-overflow: ellipsis;
            font-family: var(--font-family-mono);
        }
    }
}

.pioneer-radioselect-optgroup-label {
    font-weight: var(--weight-light-bold);
    margin: 0.5rem 0;
}

.optional-text {
    font-style: italic;
    font-weight: var(--weight-normal);
}

.pioneer-formfield-inline-group {
    .pioneer-field-inline .pioneer-label {
        padding-top: 0;
        padding-bottom: 0.4rem;
        font-size: var(--fsize-small);
    }
}

/* With a custom element for form actions we have more styling control over
 * pioneerform-fields when you need to target the last item (e.g. form-two-columns).
 * Otherwise you need an extra div element.
 */
x-form-actions {
    display: flex; /* this element needs to be blocky */
    margin: 1.2rem 0; /* See "Add token" button and forms and "Form .selection-actions". */

    > *:first-child { margin-left: 0; }

    label { margin-right: var(--w-bumper); }

    > * { vertical-align: top; }

    &.align-right { justify-content: flex-end; }

    section.posting & {
        margin: 0;
    }
}

.form-two-columns {
    /* Activate two columns layout on viewports > 600
     * We want the content of the label to define the width of first column.
     * The field columns will be pushed to the right accordingly.
     * This way the form has a more logic layout.
     * This cannot be done with Flexbox. Flexbox and flex-items needs a defined
     * width/max-width. And needs more tweaking.
     */

    @media screen and (width > 600px) {
        display: grid;
        grid-template-columns: var(--grid-form-two-columns);

        .pioneer-label {
            padding-top: 1.5rem;
            padding-right: 1.2rem;
            padding-bottom: 0.8rem;
        }

        .simple-text {
            padding-top: 1rem;
        }

        /* Align with field */
        .pioneer-formfield-inline-group > .pioneer-label { padding-top: 3.7rem; }

        .pioneer-field {
            /* override */
            margin-top: 0;
            margin-bottom: 0;
            /* --- */
            /* Use padding to add space between top and bottom border */
            padding-top: 0.8rem;
            padding-bottom: 0.8rem;

            /* make sure the .ppioneer-field has the same width as the custom search-widget */
            &:has(.search-widget) {
                width: var(--w-field);
            }
        }

        .pioneer-checkbox {
            margin-top: 0.7rem;
            margin-bottom: 1.2rem;

            &:last-child { margin-bottom: 0.4rem; }
        }

        x-form-actions {
            grid-column: 2; /* align with the fields */
        }

        .pioneer-errors { grid-column: 1 / -1; }
    }

    /* These rules are inactivated when display:contents is applied, and will
     * not bite the 2 column layout
     */
    .pioneer-formfield {
        /* Ignore this element to make the field/label elements the direct
         * children of the grid layout
         */
        display: contents;
        padding-top: 0.8rem;
    }

    input[type="file"] {
        height: var(--height-btn);
        font: var(--weight-normal) 1.3rem var(--font-family-sans);
        color: var(--text);
    }

    input::file-selector-button {
        height: var(--height-btn);
        padding: 0.6rem 1.4rem;
        color: var(--text);
        background-color: var(--fill-button);
        border: none;
        border-radius: 0.4rem;
    }

    span.pioneer-radioselect {
        display: block; /* radios are always blocky */
        margin-top: 0.7rem;
        margin-bottom: 1.2rem;
    }

    @media screen and (width <= 600px) { --w-field: 32rem; }
}

.tdc-range-input,
.pioneer-fields-inline {
    width: var(--w-field);

    display: grid;
    gap: 0 0.8rem;
    grid-template-columns: repeat(2, 1fr);

    input[type="text"],
    input[type="number"],
    select {
        /* divide --w-field in 2 equal parts */
        width: calc(var(--w-field) * 0.5 - 0.4rem);
    }
}

.tdc-select-in-a-radio {
    margin-top: 1rem;

    .pioneer-selectbox {
        display: inline-block;
    }

    select {
        width: auto;
    }
}

.token-status-form > div {
    display: flex;
    align-items: center;

    .pioneer-selectbox {
        margin: 0.2rem 0;

        select {
            height: 3.4rem;
        }
    }
}

.pioneer-fieldset {
    /* ignore this element to make the field/label elements the direct
     * children of the grid layout
    */
    display: contents;
}

.pioneer-fieldset-legend {
    margin: 3rem 0 1rem;
    padding: 2rem 0 0;
    border-top: solid 1px var(--fill-separator-on-tile); /* hr-look-a-like */
    grid-column: 1 / -1;
    font-weight: var(--weight-light-bold);
    font-size: 1.8rem;

    .form-two-columns .pioneer-fieldset:first-child &,
    .modal-content .pioneer-fieldset:first-of-type & {
        border-top: none;
        padding-top: 0;
    }

    .form-two-columns .pioneer-fieldset:first-child & {
        margin-top: 0;
    }
}

/* Form error styles
 * -----------------
 */

input:invalid   { box-shadow: none; } /* overrule ugly browser styling */

/* Field error */
.pioneer-error  {
    background-color: var(--fill-highlight-error);
    margin-bottom: 0.6rem;
    color: var(--text);
    padding: 1rem 1.3rem;
    border-left: 0.4rem solid var(--c-crimson01);
    overflow-wrap: break-word; /* for long EVSEs */
}

.pioneer-errors {
    /* Top level form errors; Dialogs may have extra text above the top
     * level error.
     */
    margin: 0.8rem 0;

    &:first-child {
        margin-top: 0;
    }
}

.pioneer-field-has-error :is(input, textarea) { border-color: var(--c-crimson01); }

.pioneer-asterisk {
    margin-left: 0.4rem;
    color: var(--c-red);
}

/* Custom radio input and checkbox
 * -------------------------------
 */

.pioneer-radioselect,
.pioneer-checkboxinput,
.pioneer-checkbox {
    margin-bottom: 0.4rem;
}

div.pioneer-radioselect:last-child  { margin-bottom: 0; }

span.pioneer-radioselect            { display: block; }

div.list-filter-radioselect-row {
    display: flex;

    span.pioneer-radioselect { margin-top: 1.2rem; }
}

div.nav-search-results span.pioneer-radioselect { margin-top: 1.2rem; }

.kajuit-checkbox-widget,
.pioneer-radioselect-label {
    display: inline-flex; /* make only the width of label text clickable */
    margin-right: 2.4rem;
    align-items: center;

    /* Hide the checkbox but keep it accessible for screen readers (also on touch devices) */
    input[type="checkbox"],
    input[type="radio"] {
        position: absolute;
        /* Avoid pos:relative on label to keep form elements scroll behind sticky elements. */
        transform: translate(-20px, 0);
        width: 1.2rem;
        height: 1.2rem;
        clip-path: circle(0);
    }

    x-form-actions & .svg-radio-widget + span,
    x-form-actions & .svg-checkbox + span { margin: 0 1.9rem 0 0;}

    /* disabled radio + checkbox style */
    input[disabled] + svg { opacity: 0.5; }
}

.svg-radio-widget,
.svg-checkbox {
    display: block;
    flex-shrink: 0;
    height: 1.2rem;

    + span {
        margin-left: 0.8rem; /* gap between checkbox and label text */
    }

    x-form-actions & { margin-right: 1rem; }

    .svg-box {
        fill: transparent;
        stroke: var(--stroke-input);
    }

    /* Checked is a solid rectangle and half is the triangle filling half the
     * rectangle for use in the indeterminate state. Hide these svg elements in
     * the unchecked state.
     */

    .svg-box-checked,
    .svg-box-half {
        fill: transparent;
    }

    input:checked + & .svg-box-checked,
    input:indeterminate + & .svg-box-half {
        fill: var(--text);
    }
}


.kajuit-checkbox-widget {
    /* Behave like an inline-element to avoid large click area, but maintain
     * the flexbox properties:
    */
    display: flex;
    width: 100%;

    input:disabled + svg + span {
        color: var(--text-disabled);
    }

    > span {
        display: block;
        width: calc(100% - 2.8rem);
        overflow-wrap: break-word;
    }

    + div {
        font-size: var(--fsize-columns);
        margin: 0.8rem 0 0 2.8rem;

        div {
            margin-bottom: 0.4rem;

            &:first-child {
                font-weight: var(--weight-light-bold);
                margin-bottom: 0.4rem;
                padding-bottom: 0.4rem;
                border-bottom: 0.1rem solid var(--fill-body);
            }
        }
    }
}


table.permissions-grid {
    /* See API Accounts */
    margin-top: 0.3rem;

    thead td { padding: 1.6rem 0; }

    th { font-weight: var(--weight-light-bold); }

    th:not(:first-child) {
        font-size: var(--fsize-columns);
        padding: 0 1.6rem 0 0;
    }

    td,
    th {
        padding-block: 0.4rem;
        padding-inline: 0;

        &:first-child { padding-left: 1.4rem; }
    }

    tr:nth-child(odd) td { background-color: var(--fill-zebra-table); }

    td:first-child { padding-right: 1.6rem; }

    .svg-box { fill: var(--fill-tile); }
}


/* =====
 * PILLS
 * =====
 */
.list-filter {
    position: relative;
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
    gap: 0.8rem 0;
    background-color: var(--fill-zebra);
    transition: grid-template-rows 0.24s ease-in;

    &::before {
        content: '';
        display: block;
        height: 0.4rem;
        background: linear-gradient(to bottom,
                    hsl(0 0% 0% / 0.08) 0%,
                    hsl(0 0% 0% / 0) 100%);
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
    }

    .fold-out {
        min-height: 0; /* needed for animation */
        align-self: end;
    }

    /* Ignore the form element to make sure the child elements are direct children
     * of .list-filter
     */
    form { display: contents; }

    .filter-actions { margin-block: 2.4rem; }
}

    .list-filter-toggle {
        /* Hide checkbox: */
        position: absolute;
        top: 0;
        clip-path: circle(0);
    }

    /* preceding selector because there can be a list-movers in between header and search: */
    .list-filter-toggle:not(:checked) ~ .list-filter { grid-template-rows: 0fr; }

    .list-filter-toggle:not(:checked) ~ .list-filter-summary { background-color: var(--fill-tile); }

.breadcrumbs {
    --mask-size: 2.4rem;

    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: nowrap;
    padding: 1.6rem 4.8rem 1.6rem var(--pad-left);
    background-color: var(--fill-tile);
    height: 6.3rem;
    border-bottom: 0.1rem solid var(--fill-separator-on-tile);

    /* Same alignment with or without icon */
    &:has(span.mask-icon) { padding-left: calc(var(--pad-left) - 3.2rem); }

    [class^="icon"] {
        flex-shrink: 0;
        transform: translateX(-0.6rem);
    }

    .crumbs {
        /* max width defined by container: */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        a {
            --text-link: var(--text);

            &:first-of-type {
                font-weight: bold;
                font-size: var(--fsize);
            }
        }
    }

    .crumb + .crumb::before {
        content: "/";
    }
}


.environment-header {
    padding: 1.2rem 2rem;
    background-color: var(--c-grayscale08);
    color: var(--c-grayscale01);
    font-weight: var(--weight-semi-bold);
}

.environment-choice-development    { background: var(--fill-pill-env-development); }
.environment-choice-staging        { background: var(--fill-pill-env-staging); }
.environment-choice-test           { background: var(--fill-pill-env-test); }
.environment-choice-demo           { background: var(--fill-pill-env-demo); }
.environment-choice-production     { background: var(--fill-pill-env-production); }


.filter-actions {
    --w-field: 34rem;
    --fsize-field: 1.3rem;

    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 2.4rem;
    font-size: 1.3rem;

    /* again, same as on form view */
    x-form-actions {
        grid-column: 2;
    }

    .pioneer-formfield {
        display: contents;
    }

    /* spacing is handled with gap */
    .pill,
    .pill-searchbox {
        margin: unset;
    }

    .form-two-columns & {

        .pioneer-label { padding-top: 1.1rem; }

        .pioneer-field { padding-block: 0.4rem; }

        .pioneer-checkboxinput .pioneer-field {
            padding-block: 0.8rem 0.4rem;
        }
    }
}


.pill {
    --fill-svg-layer1: var(--text-pill);

    margin: 0.2rem 0.4rem 0.2rem 0;
    color: var(--text-pill);
    font-size: var(--fsize-small);
    background-color: var(--fill-pill-on-body);
    border-radius: 2rem;
    display: flex;
    align-items: center;

    &:last-child { margin-right: 0; }

    > span {
        display: flex;
        align-items: center;
        padding: 0.6rem 1.4rem;
    }

    svg {
        width: 1.6rem;
        height: 1.6rem;
        margin: 0 0.8rem;
    }

    .icon-chevron-down-thick {
        width: 1.2rem;
        height: 1.2rem;
    }

    &.icon-left svg   { margin: 0 0.4rem 0 0.8rem; }
    &.icon-right svg  { margin: 0.1rem 0.8rem 0 0.4rem; }

    &.icon-left span  { padding: 0.6rem 1.4rem 0.6rem 0; }
    &.icon-right span { padding: 0.6rem 0 0.6rem 1.4rem; }

    &.selected {
        --text-pill: var(--c-grayscale01);

        background-color: var(--fill-pill-active);
    }

    /* Set the pill colors when pill carries a form value */
    input[type="hidden"]:not([value=""]) + & {
        --text-pill: var(--c-grayscale01);

        background-color: var(--fill-pill-active);
    }

    /* Overrides for pills used in stuurman */
    .rate-rules-block & {
        --text-pill: var(--text);

        background-color: var(--fill-tile);
        border-radius: 0;

        span {
            font-size: var(--fsize-columns);
            padding: 0;
            margin-right: .8rem;
        }

        &.icon-right svg  { margin: 0 0.4rem 0 0.2rem; }
    }
}

a.pill { text-decoration: none; }

button.pill { padding: 0; }

.rate-rules-block {
    .filter-actions {
        display: block;
    }

    input[type="hidden"]:not([value=""]) + .pill {
        --fill-svg-layer1: var(--text-link);
        --text-pill: var(--text-link);

        background-color: var(--fill-tile);
        font-weight: var(--weight-semi-bold);
    }

    .column-rate {
        div {
            border-radius: 0.4rem;
            border: 0.1rem solid var(--fill-tile);
            background-color: var(--fill-button);
            padding: 0.7rem 0 0.8rem 0.8rem;
            width: 100%;
        }
    }
}


/* ================
 * SCROLL INDICATOR
 * ================
 */

.scroll-container {
    overflow-x: auto;

    /* Drop shadow scroll indication when we have scroll offset;
     * The .start-shadow class is set via JS
     */
    &.start-shadow {
        .sticky-border::after,
        .sticky-column-border::after {
            position: absolute;
            top: 0;
            right: -0.7rem;
            content: "";
            width: 0.7rem;
            height: 100%;
            background: var(--gradient-shadow);
        }
    }
}

.scroll-shadow {
    position: relative;
    margin-bottom: var(--pad-bottom);

    &.show::after { display: block; }

    &::after {
        display: none;
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 3rem;
        background: var(--shadow-scroll);
    }
}

/* sticky column with border on horizontal scroll */
.sticky-column,
.sticky-border,
.sticky-column-border {
    position: sticky;
    left: 0;
    height: 100%;
    background-color: var(--fill-tile);
}

.sticky-column {
    width: var(--w-sticky);

    + .sticky-border { left: var(--w-sticky); }
}

.max-clip-medium-wide {
    max-width: 24rem;
}

.max-clip-extra-wide {
    max-width: 44rem;
}

.max-clip-medium-wide,
.max-clip-extra-wide {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.max-clip-medium-wide,
.max-clip-extra-wide {
    /* Notable A needs this, any anything else should be block as well for
     * these properies to work as expected inside a grid cell.
     */
    display: block;

     /* Note that if you use the max-* classes on the first or last column of
      * one of our matroos-grid-* grids, you will find that the minmax(1fr) has
      * a completely different influence on column widths than the
      * minmax(max-content) of the columns in between. Use with care, e.g.
      * try out with extra dummy text on all cells.
      */
}

/* With grid you don't need to set a max-width for ellipsis. It will use
 * the available space
 */
.identifier-overflow {
    display: grid;
    grid-template-columns: auto 1fr;
    white-space: nowrap;
    white-space-collapse: preserve;

    /* We need a min width to keep at least some characters visible */
    *:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        white-space-collapse: inherit;
        min-width: 6ch;
    }
}

/* =====
 * MODAL
 * =====
 */

.modal-rows-grid {
    display: grid;
    grid-template-areas: "modal-header"
                        "modal-content"
                        "modal-actions";
    grid-template-rows: minmax(3.2rem, auto) 1fr 5.4rem;
    min-height: 30rem;
    max-height: calc(100vh - 11rem);
    padding: 0 0 2.8rem;
    overflow: hidden;

    x-form-actions {
        grid-area: modal-actions;
        margin: 0;
        justify-content: flex-end;
    }
}


.modal-header {
    grid-area: modal-header;
    padding: 2.2rem 4rem 1.8rem;
    font-size: var(--fsize);
    font-weight: var(--weight-semi-bold);
    color: var(--text);
    border-bottom: 1px solid var(--fill-body);

    #confirm-delete-dialog &,
    #instruction-form &,
    #retry-form &,
    #discard-form & {
        background-color: var(--fill-actions02);
        border-bottom: 1px solid transparent;
    }
}


.modal-content {
    grid-area: modal-content;
    overflow-y: auto;
    padding: 2rem 4rem;

    &.plaintext { padding-top: 1.2rem; }

    /* Remove top spacing */
    .pioneer-formfield:first-child {
        margin-top: 0;

        .pioneer-field:first-child { margin-top: 0; }
    }

    ul[id] {
        /* ul's with an ID are generated from django form, and really
         * should have been substituted with a pioneer widget, but that
         * proved to be too complicated.
         */

        /* Hide the bullets: */
        padding-left: 0;

        li {
            display: block;
        }
    }

    .helptext {
        width: 100%;
        max-width: 100%;
        margin: 0;

        &::before { display: none; }
    }
}


.modal-search {
    --fill-svg-layer1: #868686;

    margin: 1.2rem -1.8rem 0;
    display: flex;
    align-items: center;
    border-radius: 2rem;
    background-color: var(--fill-field);

    input[type="search"] {
        width: 85%;
        max-width: unset;
        border: none;
        padding: 0.8rem 0;
        color: var(--text-link);
        background-color: var(--fill-field);
    }

    button { margin-bottom: 0; }

    .icon-search {
        width: 1.8rem;
        height: 1.8rem;
    }
}


.modal-two-columns .pioneer-formfield {
    display: grid;
    /* 24rem instead of the 1fr to keep fields in place when the scroll balk
     * appears in the modal
     */
    grid-template-columns: 24rem var(--w-field);

    /* Vertical align label with field */
    .pioneer-label {
        display: block;
        padding-top: 1.3rem;
        padding-right: 1rem;
    }
}

#close-box-form,
#instruction-form { max-width: 62rem; }

/* HTML dialogs
 * ------------
 */

dialog {
    border: none;
    width: 100%;
    max-width: 48rem;
    min-height: 30rem;
    max-height: calc(100vh - 11rem);
    overflow: hidden;
    margin-top: 10rem;
    padding: 0;
    color: var(--text);
    font-size: 1.4rem;
    line-height: normal;
    background-color: var(--fill-tile);
    box-shadow: 0 0 1rem 0 hsl(0 0% 0% / 0.30);

    /* make the backdrop darker than the default */
    &::backdrop {
        background-color: var(--fill-overlay);
        opacity: 0.5;
    }

    &#filter-tsrange [type="datetime-local"] {
        width: calc(51% - 1.2rem);

        &:first-child { margin-right: 1.2rem; }
    }

    x-form-actions {
        position: relative;
        padding: 1.8rem 4rem 0;

        div { display: flex; }

        /* Visual scroll marker */
        &::before {
            content: "";
            position: absolute;
            top: -0.4rem;
            left: 0;
            right: 0;
            display: block;
            height: 0.4rem;
            background: linear-gradient(to top,
                    hsl(0 0% 0% / 0.1) 0%,
                    hsl(0 0% 0% / 0) 100%);
        }
    }

     /* Fixes scroll issue in scrollable divs.
      * Keep the hidden radio/checkbox position in sync with the custom look.
      * Otherwise the scroll area shifts to the hidden radio/checkbox, which
      * is outside the scrollable div.
      */
    .pioneer-radioselect-label,
    .pioneer-checkboxinput label {
        position: relative;
        align-items: start;

        svg { margin-top: 0.3rem; }
    }

}

dialog.session-expired {
    padding: var(--pad-view);
    max-width: 46rem;
    background: var(--fill-tile) url("session-expired.23a8c5d52f7d.svg") no-repeat 0 72%;

    a:focus { outline: none; }
}


/* Session expired dialog */
/* ---------------------- */

.modal-session-title {
    margin-bottom: 2rem;
    font-size: 2.4rem;
    font-weight: var(--weight-light-bold);
}

.modal-session-content { height: 20rem; }

/* ------------- */


.pill-searchbox {
    --w-btn: 2.4rem;

    display: flex;
    position: relative;
    align-items: center;
    border-radius: 2rem;
    background-color: var(--fill-pill-on-body);
    border: 1px solid var(--fill-field-border);

    max-width: var(--w-field);

    /* See .pill, both need to have the same margin to get the same height in a
     * flex parent.
     * margin: 0.2rem 0.4rem 0.2rem 0;
     */

    &::before {
        content:'';
        display: block;
        height: 100%;
        position: absolute;
        top: 0;
        right: 3.1rem;
        border-left: 0.1rem solid var(--fill-field-border);
    }

    input[type="search"] {
        width: 100%;
        /* Get the same height in all browsers (fix for Safari)
         * And align the height with the button.pills
         */
        height: 2.8rem;
        max-width: unset;
        border: none;
        padding: 0.8rem 0;
        color: var(--text-link);
        background-color: transparent;
    }

    button {
        margin-bottom: 0;
        min-width: 3.2rem;
    }

    .btn {
        --fill-svg-layer1: var(--text-pill);
    }

    .icon-delete {
        width: 1.6rem;
        height: 1.6rem;
    }

    .icon-search {
        width: 1.8rem;
        height: 1.8rem;
    }
}


.highlight-block {
    /* Nope, make sure that surrounding elements reserve margin:
     * (this was a .no-margin feature class)
     */
    position: relative;
    margin: var(--pad-vert-small) 0 var(--pad-vert-small) var(--pad-left);

    /* position .edit-icon on the right side */
    display: flex;
    flex-flow: column wrap;
    gap: 1.6rem;
    align-items: start;

    .masthead & {
        margin-inline: 0;
        margin-block: 0;
    }

    /* Change the flex-direction if there is an edit button */
    &:has(> .edit-icon) {
        flex-direction: row;
    }

    h1,
    h2,
    h3 {
        margin-block: 0;
    }

    &.multi-columns {
        display: flex;
        flex-direction: row;
        gap: 2.4rem;
        align-items: start;
    }

    > *:first-child { margin-top: 0; }

    > *:last-child  { margin-bottom: 0; }

    td,
    th {
        padding: 0.1rem var(--w-bumper) 0.1rem  0;
    }

    .local-actions-parent {
        display: flex;
        justify-content: space-between;
    }

    .highlight-curtain {
        --c2c-fill: var(--fill-on-highlight01);

        font-size: var(--fsize-small);

        table {
            --fill-separator-on-tile: var(--fill-highlight-summary);

            background-color: var(--fill-on-highlight02);
            margin-bottom: 0;

            td:last-child { min-width: 8rem; }
        }

        p {
            font-style: italic;
            font-size: var(--fsize-small);
        }

        &.bootsman {
            padding: 0;
            margin-top: -1.6rem;
        }
    }

    /* table + edit a + table; See CPO EVSE detail view.
     * a + table,
     * table + table { margin-top: 1em; }
     */

    &.align-tables {
        display: grid;
        grid-template-columns: repeat(3, auto);
        justify-content: start;
        gap: 0 3.2rem;

        .align-tables-title {
            grid-row: 1; /* make sure the title is on the first row */
            padding-bottom: 0.8rem;
            font-weight: var(--weight-bold);
            border-bottom: 0.1rem solid var(--fill-separator-on-tile);
            margin-bottom: 0.8rem;
        }

        table { grid-row: 2; } /* make sure the tables are on the second row */

        table + table {
            margin-top: 0;
            border-left: 0.1rem solid var(--text);

            tr th:first-child,
            tr td:first-child {
                padding-left: 1.6rem;
            }
        }

        > div {
            align-self: stretch;
            position: relative;

            /* See above. */
            table { margin-top: 0; }

            &::after {
                content:'';
                display: block;
                width: 0.4rem;
                height: calc(100% + 3.2rem);
                background-color: var(--fill-tile);
                position: absolute;
                top: -1.6rem;
                left: -2.4rem;
            }

            &:first-child::after { display: none; }
        }
    }
}


section.download-link {
    margin: var(--w-bumper) 0;
    font-size: var(--fsize-small);
    font-weight: var(--weight-thin);
    line-height: 1;

    a {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    svg {
        --fill-svg-layer1: var(--fill-annotation);

        width: 1.2rem;
        height: 1.2rem;
    }
}


main.main-defunct {
    filter: grayscale(100%);
    color: var(--text-defunct);
}


.related-items {
    padding-block: 2.4rem var(--pad-bottom);
    position: relative;

    .title-block {
        display: flex;
        gap: 1.6rem;

        h2 {
            display: inline-block;
            margin-top: 0.4rem;
        }
    }

    > a.edit-icon {
        position: absolute;
        top: 0.7rem;
        right: 0;
    }

    /* If the section.list-charts is used, set the --fill-zebra on odd */
    .list-charts + .masthead ~ &:nth-child(odd) { background-color: var(--fill-zebra); }
    .list-charts + .masthead ~ &:nth-child(even) { background-color: transparent; }

    /* If only .masthead is used, set the --fill-zebra on odd */
    .masthead ~ &:nth-child(even){
        --fill-separator-on-tile: var(--fill-separator-on-tile-alt);

        background-color: var(--fill-zebra);
    }
}


.list-header,
.list-movers,
.list-filter,
.list-actions,
.related-items {
    padding-inline: var(--pad-left) var(--pad-right);
}

.masthead,
.list-header,
.list-movers,
.list-filter,
.related-items {

    > *:first-child { margin-top: 0; }

    > *:last-child { margin-bottom: 0; }

}

.masthead {
    display: grid;
    gap: 0 var(--pad-hor);
    grid-template-columns: 1fr fit-content(var(--w-column-tools));
    grid-template-rows: 1fr auto; /* align column details to top if column-tools is higher */
    align-items: start;
    padding-inline: var(--pad-left) 0;

    /* a not so nice way to determine if we shoud place a border-bottom */
    .listview &:has(.table-boarding-pass) {
        border-bottom: 0.1rem solid var(--fill-separator-on-tile);
    }

    .column-details {
        height: 100%;

        > * { margin-block: var(--pad-vert); }

        > section.dropout-details:not(:has(> div > table > tbody > tr)) { display: none; } /* Hide empty sections */

        .global-actions { margin-block: 0; }

        .posting {
            width: fit-content;
            margin-inline: 0;
            margin-bottom: 0.4rem;
            padding: 0.9rem 1.6rem 0.9rem 1.2rem;
            border-radius: 0.4rem;
            background-color: transparent;
            border: 0.2rem solid var(--fill-body);
            gap: 0.8rem;

            .matroos-pagination { padding: 0; }

            .message-icon {
                display: flex;
                align-items: center;

                svg { transform: translateX(0); }
            }

            + .posting { margin-top: 0.4rem; }

            /* Als de posting het laatste element is in .column-details */
            &:last-child { margin-bottom: var(--pad-vert); }

            &.warning { border-color: var(--c-tangerine01); }
            &.error { border-color: var(--c-crimson01); }
            &.success { border-color: var(--c-parakeet01); }
            &.info { border-color: var(--c-cobalt01); }
            &.processing { border-color: var(--c-canary01); }
        }

        .title-block {
            display: flex;
            gap: 1.6rem;
            align-items: flex-start;
            padding-right: 5.6rem;

            &:not(:has(.header-actions)) { display: none; }
        }
    }

    main.formview & {
        --min-width: unset;

        .form-two-columns { --grid-form-two-columns: auto 1fr; }

        .breadcrumbs { max-width: 58rem;}
    }

    /* Switch columns in report view */
    main.report-view & {
        --w-column-tools: 32rem;

        grid-template-columns: fit-content(var(--w-column-tools)) 1fr;

        .charts-object {
            text-align: left;

            > svg { font-size: 0.84rem; }
        }

        .column-tools {
            border-left: unset;
            border-right: 0.1rem solid var(--fill-separator-on-tile);
            grid-column: 1;

            > section {
                padding-left: 0;

                &:first-child { margin-top: 0.8rem; }
            }
        }

        .column-details {
            grid-column: 2;
        }
    }

    .column-tools {
        --w-field: 28rem;

        grid-column: 2;
        grid-row: 1 / 3;

        width: var(--w-column-tools);
        min-width: 32rem;
        padding: 0;
        border-left: 0.1rem solid var(--fill-separator-on-tile);
        align-self: stretch;

        section {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            padding: 0 var(--pad-hor) 0 2.4rem;
            margin: 2.4rem 0;

            &:first-child { margin-top: 5.6rem; }

            > *:first-child { margin-top: 0; }

            hr + h2 { margin-top: 0; }

            > a {
                display: flex;
                gap: 0.4rem;
                color: var(--text);
                align-items: flex-start;
                padding: 0.4rem 1rem 0.4rem 0.6rem;

                svg {
                    flex-shrink: 0;
                    height: 1.32rem;
                    width: 1.32rem;
                }

                svg,
                span {
                    margin-top: 0.2rem;
                    flex-shrink: 0;
                }
            }
        }

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            text-wrap: balance;
        }

        x-form-actions {
            .btn { margin: 0.2rem 0 0.2rem auto; }
        }

        main.report-view & { grid-row: 1; }
    }

    .no-summary,
    .no-settings,
    .ready,
    .outdated {
        text-align: center;
        margin: 3rem auto;
        padding: 6rem;
        border-radius: 0.4rem;
    }

    /* Override the grid column layout to use fixed label column.
     * This form is displayed in a 2 column tile with on the right.
     */
    .form-two-columns {
        --grid-form-two-columns: repeat(2, 1fr);

        .pioneer-formfield > div {
            border-top: none;
            border-bottom: none;
        }

        .pioneer-fields-inline .pioneer-field-inline .pioneer-label { padding-top: 0.8rem; }

        .pioneer-label {
            padding-top: 1.5rem;
            max-width: 32rem;
        }

        &.parser-settings .pioneer-selectbox {
            --w-field: 100%;
        }

        &.parser-settings .pioneer-checkboxinput {
            .column-spacer { display: none; }

            .pioneer-field { grid-column: 1 / -1; }
        }
    }

    .column-actions {
        grid-column: 1;
        grid-row: 2;
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        margin-bottom: var(--pad-vert);

        x-form-actions { margin-block: 0; }
    }
}

/* --------
 * HOMEPAGE
 * --------
 */

/* Responsive home page tiles
 * max 6 columns, but when < 6 it should grow evenly in the available space
 * With 6 items it should shrink evenly in the available space.
 */

main.dashboard {
    background-color: transparent;
    padding-block: 1.2rem 0;
}


section.dashboard-welcome {
    display: none;

    /* The action-tiles is always here, but can be empty: */
    section:not(:has(*)) + & { /* :empty */
        display: block;
    }
}


.chart-object-tile,
.action-tiles {
    width: 100%;
    max-width: 132rem;
    margin: 1.6rem auto 0;
}

.action-tiles {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    background-color: transparent;

    /* If there is only one tile do ... */
    &:has(:only-child) {
        .action-tile {
            max-width: calc(50% - 0.8rem);
        }

        &::before {
            content: '';
            display: block;
            width: calc(50% - 0.8rem);
            height: 100%;
            position: absolute;
            top: 0;
            right: 0;
            background-color: var(--fill-tile-placeholder);
        }
    }

    /* If there are max 2 tiles do ... */
    &:has(:only-child,
          :first-child + :last-child) {
        .action-tile {
            display: grid;
            grid-template-columns: var(--mask-size) 1fr;
            gap: 0 2.4rem;
            padding: 4.8rem;

            span { grid-row: 1/3; }

            div { text-align: left; }
        }
    }

    &:has(:nth-child(7)) {
        .action-tile {
            --fsize: 1.4rem;
            --fsize-total: 3.2rem;
            --mask-size: 4.8rem;
        }

        @media screen and (width <= 880px) {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
        }
    }
}

.action-tile {
    --mask-size: 6.4rem;
    --fill-mask-icon: var(--gradient-icon-1);

    display: flex;
    flex: 1 0 4rem;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem 0;
    text-align: center;
    padding: 4.8rem 2.4rem;
    font-size: var(--fsize);
    color: var(--text);
    background-color: var(--fill-tile);

    span {
        transform: scale(1);
        transition: transform 0.12s ease-out;
    }

    &:hover span { transform: scale(1.06); }

    @media screen and (width <= 1000px) {
        --fsize: 1.4rem;
        --fsize-total: 3.2rem;
        --mask-size: 4.8rem;

        padding: 3.2rem 1.6rem;
    }

    .total { font-size: var(--fsize-total); }

    &.gradient-1 { --fill-mask-icon: var(--gradient-icon-1); }
    &.gradient-2 { --fill-mask-icon: var(--gradient-icon-2); }
    &.gradient-3 { --fill-mask-icon: var(--gradient-icon-3); }
    &.gradient-4 { --fill-mask-icon: var(--gradient-icon-4); }
}

.action-tile,
.chart-object-tile {
    filter: drop-shadow(0 0 0.2rem var(--fill-tile-shadow));
}

/* ------------------------------ */


/* ------------------------------
 * Homepage chart object scroller
 */

.chart-object-tile {
    padding: 2.4rem 4rem;
    background-color: var(--fill-tile);

    a { color: var(--text); }

    .list-charts { margin-inline: 0; }
}

.chart-tile-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.4rem;
    font-weight: var(--weight-normal);
    margin-top: 1.2rem;

    span { font-weight: bold; }

    [class^="icon"] {
        --mask-size: 2.6rem;

        flex-shrink: 0;
        margin-right: 0.2rem;
    }
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    font-size: var(--fsize-small);
    font-weight: var(--weight-normal);
    margin-bottom: 0.8rem;

    > div {
        display: flex;
        align-items: center;
        gap: 0.4rem;

        .legend-line {
            width: 2rem;
            height: 0.2rem;
        }

        .legend-line-0 {
            background-image: linear-gradient(
                to right, var(--c-carmine) 71%, transparent 71%
            );
            background-size: 0.7rem 0.2rem;
        }

        .legend-line-1 { background-color: var(--c-blue01); }
    }
}

.total-items,
.total-errors {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: 0.4rem;
    vertical-align: top; /* fix alignment in Safari */
    font-size: 80%;
    height: 1.6rem;
    border-radius: 0.2rem;

    &.total-items {
        background-color: var(--fill-pill-active);
        color: var(--c-grayscale01);
    }

    &.total-errors {
        background-color: var(--c-crimson01);
        color: var(--c-grayscale01);
    }
}


.annotation-markers {
    display: inline-block;
    margin-left: 0.6rem;
}

.annotation-marker {
    display: inline-block;
    position: relative;
    padding: 0.1rem 0.6rem 0.2rem;
    vertical-align: top; /* fix alignment in Safari */
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--fill-annotation);
    border-radius: 1rem;
    outline: 0.1rem solid var(--fill-annotation);
    margin-right: 0.2rem;
}

.summary .annotation-marker::after { --fill-tile: var(--fill-highlight-summary); }

.object-defunct,
.instruction-disabled {
    /* See defunctclass template filter
     * See links to subscriptions-detail and reimbursement-arrangements-detail
     */
    text-decoration-line: line-through;
}

.list-header,
.list-actions {
    padding-block: var(--pad-vert-small);
}

.list-header {
    --height-btn: 3rem;

    display: flex;
    align-items: center;
    gap: 0.8rem;

    @media screen and (width <= 900px) {
        flex-wrap: wrap;
    }

    small {
        transform: translateY(0.16rem); /* see dropout cases */
    }

    &.has-collection-icon {
        --mask-size: 2.4rem;

        padding-inline: calc(var(--pad-left) - 3.2rem) var(--pad-right);

        h1 { margin-left: 0; }

        .mask-icon { transform: translateX(-0.6rem); }
    }

    .highlight-block + & {
        margin-top: 2.4rem;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        margin: 0;
        font-size: var(--fsize);
        font-weight: var(--weight-bold);
        text-wrap: nowrap;
    }

    .filter-actions + .matroos-pagination { margin-left: 1.2rem; }

    .filter-actions { margin-top: 0; }

    > .list-header-right-align {
        display: flex;
        gap: 0.8rem;
        align-items: center;
        justify-content: flex-end;
        flex-grow: 1;
        margin-left: 1.6rem;

        form { display: contents; }

        .filter-nav {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            flex-shrink: 0;
        }
    }

    .list-header-reports-links {
        color: var(--text-link);

        a {
            display: inline-flex;
            width: max-content;
            height: 2.4rem;
            gap: 0.4rem;
            color: var(--text);
            align-items: center;
            padding: 0.4rem 1rem 0.4rem 0.6rem;
            border-radius: 1.2rem;
            border: 0.1rem solid var(--fill-tile);

            &:hover {
                border: 0.1rem solid var(--fill-button);
            }

            svg {
                height: 1.32rem;
                width: 1.32rem;
            }
        }
    }

    .total-items {
        transform: translateY(0.1rem);
    }

    .btn.icon-right {
        border-radius: 2rem;
        padding: 0.6rem 0 0.4rem 1.4rem;
        margin: 0;

        svg { margin-top: -0.2rem; }
    }
}

.list-filter-toggle-button.active { background-color: var(--fill-button); }

.list-filter .btn.modified[type="submit"] {
    --fill-svg-layer1: var(--c-grayscale01);

    background-color: var(--fill-pill-active);
    color: var(--c-grayscale01);
}


.list-filter-summary {
    position: relative;
    padding-inline: var(--pad-left) var(--pad-right);
    padding-block: 0.8rem;
    border-top: 0.1rem solid var(--fill-body);
    background-color: var(--fill-zebra);

    .list-filter-summary-current {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.4rem;

        .clear-filters,
        .clear-filter-one {
            --fill-svg-layer1: var(--c-grayscale01);

            display: flex;
            align-items: center;
            gap: 0.3rem;
            background-color: var(--fill-pill-active);
            color: var(--c-grayscale01);
            font-weight: var(--weight-normal);
            font-size: 1.3rem;
            text-wrap: nowrap;

            height: 2rem;
            padding-inline: 0.9rem 0.4rem;
            padding-top: 0.1rem;
            border-radius: 1rem;
            flex-shrink: 0;

            cursor: pointer;

            span,
            .list-filter-expand-component {
                padding-bottom: 0.2rem;
            }

            svg {
                width: 1.4rem;
                height: 1.4rem;
            }
        }

        .clear-filter-one:last-of-type { margin-right: 1.4rem; }

        > span {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 2.4rem;
            height: 2.4rem;
            cursor: pointer;
            position: absolute;
            top: 0.6rem;
            left: calc(var(--pad-left) - 3.8rem);

            svg.icon-filter {
                --fill-svg-layer1: var(--fill-active-filters);

                width: 1.6rem;
            }
        }
    }
}


/* scrollable chart */
section.list-charts {
    display: grid;
    grid-template-columns: 2.8rem 1fr 2.8rem;
    align-items: center;
    margin: var(--pad-vert) 0 0;

    .chart-prev,
    .chart-next {
        --fill-svg-layer1: var(--c-grayscale08);

        grid-row: 1;
        height: 3.4rem;
        width: 2.8rem;
        background-color: var(--fill-tile);
        border: 0.1rem solid var(--fill-field-border);
        cursor: pointer;
        transform: translateY(-1.6rem);

        svg {
            width: 1.6rem;
            height: 1.6rem;
        }
    }

    .chart-prev {
        grid-column: 1;
        border-radius: 0 0.4rem 0.4rem 0;
    }

    .chart-next {
        grid-column: 3;
        border-radius: 0.4rem 0 0 0.4rem;
    }

    .charts-object {
        grid-row: 1;
        grid-column: 1 / -1;
        overflow: auto hidden;
        scroll-behavior: smooth;
        /* Load image scrolled to right */
        display: flex;
        flex-direction: row-reverse;
        height: var(--scroller-height);
        margin: 0;

        border-left: 0.1rem solid var(--fill-field-border);
        border-right: 0.1rem solid var(--fill-field-border);

        > svg {
            /* keep svg size intact, do not resize */
            flex-shrink: 0;
            font-size: 0.84rem;
        }
    }

    .scroll-mask {
        grid-row: 1;
        grid-column: 1 / -1;
        height: var(--scroller-height-mask);
        background-color: var(--fill-tile);
        align-self: flex-end;
    }

    + .list-header {
        margin-top: 0;
    }
}


section.list-actions,
section.shopping-cart {
    /* list view charge session bottom */
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--fill-tile);
    border-top: 0.1rem solid var(--fill-separator-on-body);

    /* aligning activity-center and the helptext */
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    /* We get 1.2rem extra top space from the margins on the form: */
    padding-inline: calc(var(--pad-left) - 3.3rem) var(--pad-right);
    padding-block: 1.6rem;

    .helptext { margin: 0 1.6rem; }
}

section.list-actions { padding-inline: var(--pad-left) var(--pad-right); }

.helptext  {
    position: relative;
    display: flex;
    gap: 0.4rem;
    padding: 1.2rem 1.6rem;
    margin: 0 1.6rem 0 0;
    background-color: var(--fill-helptext);
    border-radius: 0.2rem;
    max-width: 40rem;

    &::before {
        content: '';
        position: absolute;
        bottom: -1.2rem;
        left: 0rem;
        border-top: 1.4rem solid var(--fill-helptext);
        border-right: 1.4rem solid transparent;
    }
}

section.shopping-basket {
    position: sticky;
    bottom: 0;
    margin-bottom: calc(0rem - var(--pad-view)); /* Run into the main padding */

    div {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        border-top: 0.1rem solid var(--fill-body);
        background-color: var(--fill-tile);
        padding: 1.6rem 0;

        form { display: contents; }
    }
}


.matroos-pagination {
    display: flex;
    align-items: center;
    padding: 0.2rem 0.4rem;

    .icon-chevron-left,
    .icon-chevron-right {
        width: 1.6rem;
        height: 1.6rem;
    }

    span.disabled,
    button[disabled] { --fill-svg-layer1: var(--text-disabled); }
}


.activity-center {
    width: fit-content;
    flex-shrink: 0;
    margin: 1rem 0.8rem 1rem 3.2rem;

    form { display: contents; }
}

.download-actions {
    &.activity-center { margin: 1rem 0.8rem 1rem 3.2rem; }

    .btn { position: relative; }

    .state-icon {
        --mask-size: 1.8rem;

        margin-left: 0.4rem;
        margin-right: 0.7rem;
    }
}


/* This is a special flavour download icon, set via css mask from static folder */
.state-icon.icon-download {
    width: var(--mask-size);
    height: var(--mask-size);
    background-color: var(--text);
    mask-image: url("icon-download.8d23e37ffc45.svg");
    mask-size: var(--mask-size);

    [disabled] &,
    .inactive & {
        background-color: var(--text-disabled);
    }
}


.selection-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    .pioneer-checkboxinput {
        margin: 0 2.4rem 0.8rem -3.2rem;

        .pioneer-field { margin-bottom: 0; }
    }
}


.selection-actions-help {
    max-width: 16em;
    margin: 0.6rem 2.4rem 0.6rem 0;
}


/* ====================
 * DEFAULT COLUMNS LIST
 * ====================
 */

.column-right {
    /* right-align grid divs, not for table cells (align=right): */
    text-align: right;
}


.matroos-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    margin: 4px 24px 4px auto;
    background-color: #e1e1e1;
    visibility: hidden;

    /*
     * validity period: history, live, future
     */

    &.roaming-connection-nothing,
    &.priced,
    &.completed,
    &.discarded,
    &.dropout,
    &.pending,
    &.waiting_for_reimbursement,
    &.history,
    &.deactivated {
        background-color: #a0a0a0; /* GREY */
        visibility: visible;
    }

    &.outflow,
    &.inflow {
      visibility: visible;
      margin-inline: 1.2rem 0.4rem;
      width: 0.8rem;
      height: 0.8rem;
      border-radius: 0.4rem;
    }

    &.outflow { background-color: var(--fill-outflow); }

    &.inflow { background-color: var(--fill-inflow); }

    &.live,
    &.unprocessed {
        background-color: #52b1ff; /* CYAN */
        visibility: visible;
    }

    &.invalid-new,
    &.roaming-connection-fails,
    &.task-state-attention,
    &.dropout-import,
    &.unresolved  {
        background-color: var(--fill-pill-active); /* BLUE */
        visibility: visible;
    }

    &.future {
        background-color: #f9e13c; /* YELLOW */
        visibility: visible;
    }

    &.frozen {
        /* friends with the adjacent checkbox input, same color: */
        background-color: var(--stroke-input);
        visibility: visible;
    }

    &.task-state-running {
        --mask-size: 1.4rem;

        margin: 0px 20px 0px auto;
        background-color: transparent;
        visibility: visible;

        position: relative;
        width: var(--mask-size);
        height: var(--mask-size);

        &::after {
            display: block;
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            width: var(--mask-size);
            height: var(--mask-size);

            background-image: var(--icon-spinner);
            background-size: contain;
            animation: animSpinner 1s linear infinite;
        }
    }
}


.matroos-checkbox {
    display: block;
    width: 1.1rem;
    margin: 0.2rem 2.1rem 0 auto;

    /* Hide the checkbox but keep it accessible for screen readers (also on touch devices) */
    input[type="checkbox"] {
        position: absolute;
        /* Avoid pos:relative on label to keep form elements scroll behind sticky elements. */
        transform: translate(-20px, 0);
        width: 1.1rem;
        height: 1.1rem;
        clip-path: circle(0);
    }

    /* overrides */
    .svg-checkbox {
        margin-right: 0;
        transform: translateY(-2px);
    }
}


.matroos-heading,
.matroos-item {
    display: contents;
    font-size: var(--fsize-columns);

    > div {
        white-space: nowrap;
        padding: 0.6rem 2.4rem 0.6rem 0;
        color: var(--text);
        background-color: var(--fill-tile);
        border-top: 0.1rem solid var(--fill-body);

        /* Empty element to fill out the complete row, where the last "real"
         * column is right aligned.
         */
        &.matroos-coil-spring { padding-right: 0; }

        &.checkbox-column { padding: 0.6rem 0; }

         /* .matroos-grid-#-cols starts with the special checkbox column width.
          * If you don't need a checkbox column, you need to add this grid column
          * to your first column.
          * For example: You have 13 columns of content, use the fourteen-columns layout.
          * Add this class to your first column.
          * It will add the checkbox grid column to your first column.
          */
        &.grid-column-span {
            grid-column: span 2;
            padding-left: 4rem;
        }
    }

    &.exception-rule > div {
        padding: 0.2rem 2.4rem 0.6rem 0;
        border-top: 0;

        a::before {
            content: '';
            display: inline-block;
            width: 1.6rem;
            height: 0.5rem;
            border-bottom: .1rem solid var(--text-link);
            border-left: .1rem solid var(--text-link);
            margin: 0 0.4rem 0.3rem 0.8rem;
        }
    }
}


.matroos-heading {
    align-items: center;
    font-weight: var(--weight-light-bold);

    > div.sorter {
        --mask-size: 0.9rem;

        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.2rem;
        padding-right: 1.3rem;

        &::after {
            display: block;
            content: '';
            width: var(--mask-size);
            height: var(--mask-size);
            background-color: var(--fill-sorter);
            mask-image: url("icon-sorter.ed01cd5ebf1c.svg");
            mask-size: var(--mask-size);
        }
    }

    > div.sorter.desc,
    > div.sorter.asc {
        --fill-sorter: var(--text);
    }

    > div.sorter.desc::after { transform: rotate(180deg); }
}

.matroos-heading:has(+ .matroos-no-results) {
    display: none;
}

.matroos-item {
    &:last-child > div { border-bottom: 0.1rem solid var(--fill-body); }

    .mismatch-marker {
        background-color: var(--fill-mismatch-marker);
        min-width: 100%;
    }
}

.matroos-no-results {
    /* Span all available grids lines: */
    grid-column: 1 / -1;
    padding: 5.6rem 0;
    border-top: 0.1rem solid var(--fill-body);

    span {
        padding: 1.2rem 1.6rem;
        background-color: var(--fill-helptext);
        border-radius: 0.2rem;
        margin-left: var(--pad-left);
        position: relative;

        &::before {
            content: '';
            position: absolute;
            bottom: -1.2rem;
            left: 0rem;
            border-top: 1.4rem solid var(--fill-helptext);
            border-right: 1.4rem solid transparent;
        }
    }
}


[class*="matroos-grid-"] { display: grid; }

.matroos-grid-2-cols,
.matroos-grid-two-cols {
    grid-template-columns: var(--pad-left) minmax(1rem, 1fr);
}

.matroos-grid-3-cols,
.matroos-grid-three-cols {
    grid-template-columns: var(--pad-left) max-content minmax(max-content, 1fr);
}

.matroos-grid-4-cols,
.matroos-grid-four-cols {
    grid-template-columns: var(--pad-left) repeat(2, max-content) minmax(max-content, 1fr);
}

.matroos-grid-5-cols,
.matroos-grid-five-cols {
    grid-template-columns: var(--pad-left) repeat(3, max-content) minmax(max-content, 1fr);
}

.matroos-grid-6-cols,
.matroos-grid-six-cols {
    grid-template-columns: var(--pad-left) repeat(4, auto) minmax(max-content, 1fr);
}

.matroos-grid-7-cols,
.matroos-grid-seven-cols {
    grid-template-columns: var(--pad-left) repeat(5, auto) minmax(max-content, 1fr);
}

.matroos-grid-8-cols,
.matroos-grid-eight-cols {
    grid-template-columns: var(--pad-left) repeat(6, auto) minmax(max-content, 1fr);
}

.matroos-grid-9-cols,
.matroos-grid-nine-cols {
    grid-template-columns: var(--pad-left) repeat(7, auto) minmax(max-content, 1fr);
}

.matroos-grid-10-cols,
.matroos-grid-ten-cols {
    grid-template-columns: var(--pad-left) repeat(8, auto) minmax(max-content, 1fr);
}

.matroos-grid-11-cols,
.matroos-grid-eleven-cols {
    grid-template-columns: var(--pad-left) repeat(9, auto) minmax(max-content, 1fr);
}

.matroos-grid-12-cols,
.matroos-grid-twelve-cols {
    grid-template-columns: var(--pad-left) repeat(10, auto) minmax(max-content, 1fr);
}

.matroos-grid-thirteen-cols {
    grid-template-columns: var(--pad-left) repeat(11, auto) minmax(max-content, 1fr);
}

.matroos-grid-fourteen-cols {
    grid-template-columns: var(--pad-left) repeat(12, auto) minmax(max-content, 1fr);
}

.matroos-grid-fifteen-cols {
    grid-template-columns: var(--pad-left) repeat(13, auto) minmax(max-content, 1fr);
}

.matroos-grid-sixteen-cols {
    grid-template-columns: var(--pad-left) repeat(14, auto) minmax(max-content, 1fr);
}

.matroos-grid-seventeen-cols {
    grid-template-columns: var(--pad-left) repeat(15, auto) minmax(max-content, 1fr);
}

.matroos-grid-eighteen-cols {
    grid-template-columns: var(--pad-left) repeat(16, auto) minmax(max-content, 1fr);
}


.highlight-table {
    th,
    td {
        padding-right: 2.4rem;


        &:last-child { padding-right: 0; }
    }

    th:not([valign]),
    td:not([valign]) {
        vertical-align: top;
    }

    tbody th,
    tbody td {
        font-weight: 300;
    }

    .related-items & {
        position: relative;
    }

    .summary & tbody th { font-weight: var(--weight-normal); }

    .timeline-markup {
        /* See CPO reimbursement arrangement calculation input detail view. */
        display: inline-block;

        &.future,
        &.history {
            background-color: var(--fill-timeline-markup);
        }
    }

    /* The highlight table header should be there if the table is editable.
     * This header sort of positions the edit button
     */
    thead {
        th {
            padding-bottom: 0.8rem;
            font-weight: var(--weight-bold);
            border-bottom: 0.1rem solid var(--fill-separator-on-tile);
        }

        + tbody tr:first-child td,
        + tbody tr:first-child th {
            padding-top: 0.8rem;
        }
    }
}


/* Content form toggle */
.bootsman-input-toggle {
    position: absolute;
    clip-path: circle(0);

    &:checked {
        /* Set height based on content */
        + .bootsman {
            grid-template-rows: 1fr;
            margin-top: -0.4rem;
        }

        + .bootsman.bootsman-form {
            border-top: 0.1rem solid var(--fill-separator-on-tile);
            padding: 0.8rem 0 1.6rem;
            margin-top: 0.8rem;
        }

        ~ label svg { transform: scaleY(-1); }

        ~ label div span {
            &:nth-child(1) { display: none; }
            &:nth-child(2) { display: block; }
        }
    }

    &:focus-visible ~ label {
        outline: 0.5rem auto Highlight; /* Firefox */
        outline: 0.5rem auto -webkit-focus-ring-color; /* Chrome, Safari */
    }
}

.bootsman {
    display: grid;
    grid-template-rows: 0fr;

    &.bootsman-form {
        padding: 0;
        margin-top: 0.8rem;
    }

    /* Hide content when grid-row is 0fr; */
    .bootsman-collapsible { overflow: hidden; }

    .form-two-columns & {
        grid-column: 1 / -1;

        @media screen and (width > 600px) {
            display: grid;

            /* Grid inheritance is not supported yet: */
            grid-template-columns: var(--grid-form-two-columns);
        }
    }
}

.form-label {
    --fill-svg-layer1: var(--text-link);

    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    margin: 0;
    padding: 0.8rem 0;
    border-top: 0.1rem solid var(--fill-separator-on-tile);

    svg {
        width: 1.6rem;
        height: 1.6rem;
        display: block;
        background-color: var(--fill-tile);
    }

    div span {
        color: var(--text-link);

        &:nth-child(1) { display: block; }
        &:nth-child(2){ display: none; }
    }
}

.highlight-label {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    height: 2.4rem;
    margin-block: -0.6rem;
    width: 2.4rem;
    border-radius: 1.2rem;
    margin-inline: 0.4rem;
    background-color: var(--fill-on-highlight01);
    cursor: pointer;

    svg {
        width: 1.2rem;
        height: 1.2rem;
    }

    .highlight-block:has(.bootsman-input-toggle:checked) & {
        svg { scale: 1 -1; }
    }
}

.scroll-right-fixed {
    display: grid; /* Listen to the width of child elements to keep bg intact, when it overflows. */
    overflow-x: auto;
}


/* Add this to the parent of the table */
.scroll-table { overflow-x: auto; }


.stuurman {
    margin: 1.2rem 0;
    font-size: var(--fsize-columns);

    th,
    td {
        padding: 0.6rem 2.4rem 0.6rem 0;
        font-weight: inherit; /* the bold on th's don't need the attention here. */
    }

    thead th:not([valign]),
    thead td:not([valign]) {
        vertical-align: middle;
    }

    .token-status & {
        th,
        td {
            vertical-align: top;
        }
    }

    .rule-filters {
        th,
        td {
            /* More space for the pills in the Rate plan Rules page */
            padding: 2.4rem 0rem;
            vertical-align: middle;
        }
    }

    &:not(:has(tbody)) {
        /* Hide the table if there is no tbody; Use this to hide an entire table,
         * but make sure you don't hardcode an empty tbody, as :empty() with
         * whitespace is even more unsupported than :has.
         * Does not work for Firefox.
         */
        display: none;
    }

    tbody th,
    tbody td {
        border-top: 0.1rem solid var(--fill-separator-on-tile);
    }

    tbody tr:last-child th,
    tbody tr:last-child td {
        border-bottom: 0.1rem solid var(--fill-separator-on-tile);
    }

    tfoot tr:first-child td,
    tfoot tr:first-child th {
        padding-top: 1.5rem;
    }

    tfoot td,
    tfoot th {
        /* no border, less space needed */
        padding: 0.4rem 2.4rem 0.4rem 0;
    }

    .column-icon {
        padding: 0.6rem 0;
        min-width: 2.4rem;

        -webkit-user-select: none;
        user-select: none;
    }

    tr.outdated {
        text-decoration: line-through;
    }

    .column-date {
        min-width: 9rem;

        .dt {
            /* to prevent horizontal friction in case of expand table */
            display: block;
            height: 1.41rem;
        }
    }

    .column-date small {
        /* hide time unless expanded: */
        display: none;
    }

    .expand-value-expanded { display: none }

    &.expand-table-tool-expanded {
        .column-date small { display: inline }

        .expand-value-default { display: none }

        .expand-value-expanded { display: inline }
    }

    .filter-cell {
        white-space: nowrap;
    }

    .annotation-flex {
        /* used to wrap the annotation markers and give
         * them a 0.2rem gap. Instead of a margin-bottom
         */
        display: flex;
        flex-wrap: wrap;
        gap: 0.2rem;
    }

    div.missing-value-cell {
        background: var(--fill-missing-value);
        padding: 0 1rem;
        border-radius: 3px;
    }
}


.stuurman-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    margin-top: 4px;
    margin-left: 6px;
    background-color: #e1e1e1;
    visibility: hidden;

    &.unresolved  {
        background-color: var(--fill-pill-active); /* BLUE */
        visibility: visible;
    }
}


.script-errors {

    .error {
        display: flex;
        align-items: flex-start;
        max-width: 48rem;
        gap: 2.4rem;
        margin: 1.2rem 0;
    }
}


.variables-list {
    display: grid;
    grid-template-columns: 16rem auto;

    h2 {
        margin-top: 0;
        width: 14rem;
        font-size: 1.4rem;
    }

    > div {
        flex-wrap: wrap;
    }

    ul {
        list-style-type: none;
        margin-top: 0.2rem;
        margin-bottom: 2rem;
        padding: 0 2rem 0 0;
        font-size: var(--fsize-columns);

        li:not(:first-child) {
            padding-left: 1.4rem;
        }
    }
}

.variable-title { font-weight: var(--weight-semi-bold); }

.sum-total-table-cell {
    font-size: var(--fsize);
    font-weight: var(--weight-bold);
}


.outlier-number {
    /* See CDR Import or MspCsImportParseSummary */
    font-size: var(--fsize);
    font-weight: var(--weight-bold);
    color: var(--c-crimson01);
}


/* ellipsis edit button */
.edit-icon {
    height: 1.2rem;
    text-align: center;
    cursor: pointer;

    svg {
        width: 1.2rem;
        height: 1.2rem;
    }

    .stuurman & svg { transform: translate(0, -0.2rem); }

    /* Styling the trash icon */
    .stuurman & svg.icon-trash {
        transform: translate(0, -0.1rem);
        width: 1.4rem;
        height: 1.4rem;
    }

    .masthead .highlight-block &,
    .masthead .title-block &,
    .related-items .title-block & {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--fill-edit-icon);
        width: 3.2rem;
        min-width: 3.2rem;
        height: 3.2rem;
        border-radius: 50%;
        margin-top: -0.4rem;
        transition: background-color 0.12s ease-in-out;

        &:hover { background-color: var(--fill-edit-icon-hover); }
    }
}


.linesman-icon {
    --mask-size: 1.4rem;

    width: var(--mask-size);
    height: calc(var(--mask-size) * 2 / 3);
    background-color: var(--text-link);

    td:first-child & {
        position: absolute;
        transform: translate(-1.6rem, 0.3rem);
    }

    th > &,
    td > & {
        /* Cell height is probably higher from adjacent cells and it's probably
         * valign top'ped, so we need to move the icon down to the implied
         * baseline; When the element is nested deeper in the table cell (see
         * rate rules) it might be an inline element that does _not_ need
         * a transform.
         */

        .stuurman thead & { transform: translateY(0);}
    }

    &.history {
        mask-image: url("icon-past.eee6663d549f.svg");
        mask-size: var(--mask-size);
    }

    &.live {
        visibility: hidden;
        mask-image: url("icon-present.e22cf028e47b.svg");
        mask-size: var(--mask-size);
    }

    &.future {
        mask-image: url("icon-future.eee6663d549f.svg");
        mask-size: var(--mask-size);
    }

    &.flag-swallowtail {
        mask-image: url("icon-flag-swallowtail.e32254c60cd0.svg");
        mask-size: var(--mask-size);
    }

    &.flag-triangle {
        mask-image: url("icon-flag-triangle.6378955296cc.svg");
        mask-size: var(--mask-size);
    }

    .checkbox-column & { margin: 0.3rem 1.8rem 0 auto; }
}


span.linesman-icon {
    display:inline-block;

    .stuurman & {
        /* correction puts all .linesman-icon on the same "baseline" */
        transform: translateY(0.1rem);
    }
}


.expand-table-tool {
    --mask-size: 1.4rem;

    display: inline-block;
    width: 0;
    height: calc(var(--mask-size) * 2 / 3);
    overflow: visible;

    div {
        width: var(--mask-size);
        height: calc(var(--mask-size) * 2 / 3);
        transform: translateX(-3rem);
        background-color: var(--text);
        cursor: pointer;

        mask-image: url("icon-expand.0701c1645b66.svg");
        mask-size: var(--mask-size);
    }

    .expand-table-tool-expanded & {
        div {
            mask-image: url("icon-reduce.3c76739063d8.svg");
            mask-size: var(--mask-size);
        }
    }
}

/* fix the the spacing between the .expand-table-tool and the first word */
.stuurman th:has(.expand-table-tool) {
    display: flex;
    align-items: center;
}

.add-item {
    background-color: var(--fill-button);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.2rem;
    margin: 0 0.3rem;

    svg {
        width: 1.2rem;
        height: 1.2rem;
    }
}


.header-actions {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;

    h1 {
        /* See rate plans view, the (...) label dialog opener.
         * Add spacing between last button and local actions
         */
        button:last-of-type { margin-right: 1rem; }
    }

    .local-actions {
        flex-grow: 1;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-bottom: 1rem;

        form { display: contents; }
    }
}


.table-boarding-pass {
    --padding: 1.2rem;

    + & {
        margin-top: 2.4rem; /* Space in between two tables */
    }

    th:not([valign]),
    td:not([valign]) {
        vertical-align: top;
    }

    th {
        padding: 0 var(--padding) 0.2rem 0;
        font-weight: inherit; /* Reset to "normal" */
        text-align: left;
        white-space: nowrap;

        &:last-child { padding-right: 0; }
    }

    td {
        padding: 0 var(--padding) 0 0;

        &:last-child { padding-right: 0; }
    }

    h1 {
        margin: 0;
    }

    a.pos-align-right {
        position: absolute;
        top: 1.2rem;
        right: 2.8rem;
    }

    .linesman-icon { display: inline-block; }
}


.svg-sprite {
    display: flex; /* avoid spacing */
    visibility: hidden;
}


/* Use important to make sure we override any rule with more specificity: */
.no-display { display: none !important; }

.no-visible {
    visibility: hidden;
    height: 0; /* remove the elements' height */
}

.timeline-markup {
    /* &.live: nothing */

    &.future > *,
    &.history > * {
        background-color: var(--fill-timeline-markup);
    }
}


.column-date,
.number {
    /* Visually make monospaced font look as big as regular text: */

    font-feature-settings: "tnum", "kern";
    /* font-size: 1.06rem is based on the usage in the grid column layout,
     * which has a default size of 1.14rem. When converting to percentage we get
     * a nice font size of 93% which can be applied for all situations and works
     * cross browser:
     */

    /* ------------------------------------------
     * grid columns || 1.06 / 1.14 =  92.9824561%
     * detail table || 1.2 / 1.3   = 92.30769230%
     * ------------------------------------------
     */

    font-size: 93%;

    letter-spacing: -0.02rem;

    /* Firefox renders the line-height nicely when using percentage font size.
     * Chrome and Safari still need a fix for this:
     */
    line-height: 1.41rem;
    /* This value sets the correct line-height when the base font size is 1.14rem
     * or 1.3rem. In other cases you'll need to override the line-height.
    */
}

td.sortable { padding-left: 2.2rem; }

th.column-sort {
    padding-left: 0;
    white-space: nowrap; /* keep sort arrows + title together */

    span { vertical-align: middle; }
}

.sorting {
    --pos-left-bg: 0.8rem;

    display: inline-block;
    width: 2rem;
    height: 1.4rem;
    vertical-align: middle;
    background-image: url("sorting-sprite.e0329b497d8c.svg");
    background-repeat: no-repeat;
    background-position: var(--pos-left-bg) -1.3rem;
    background-size: 3.8rem 3.8rem;
    cursor: pointer;

    &.asc  { --pos-left-bg: -0.8rem; }

    &.desc { --pos-left-bg: -2.4rem; }
}

.summary-line {
    /*
     * "Status: Active, Active rate rules: 9, Subscriptions: 12.097"
     */
    margin: 1em 0;
    max-width: 76rem; /* 84rem - padding 4rem (left and right) */

    .header-actions + & {
        /* Oh shoot, header actions is a flex box, we don't get our
         * collapsing margins, let's say that the header actions bottom
         * margin is all we need:
         */
        margin-top: 0;
    }
}


.charge-session-progress-spinner {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: var(--mask-size);
    height: var(--mask-size);
    background-image: var(--icon-spinner);
    background-size: contain;
    animation: animSpinner 1s linear infinite;
}


.search-widget {
    position: relative; /* for the results dropdown + spinner positioning */

    /* Also see .spinner on the result list that moves to this exact
     *  same position.
     */
    &.action-confirmed {

        input[type="text"] {
            padding-right: 3.2rem;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        &::after {
            --mask-size: 1.8rem;

            display: block;
            content: "";
            position: absolute;
            right: 0.8rem;
            top: 7px; /* FIXME isnt' there a logical computation for valign middle? */
            width: var(--mask-size);
            height: var(--mask-size);
            background-color: var(--text);
            mask-image: url("icon-checkmark-fat.0b69206a8f70.svg");
            mask-size: var(--mask-size);
        }
    }
}

.search-widget-results {
    position: absolute;
    top: 3.4rem;
    left: 0;
    right: 0; /* Needs to be set for positioning the spinner */
    font-size: var(--fsize-field);
    background-color: var(--fill-tile);
    box-shadow: 0 0 var(--w-bumper) 0 rgb(0 0 0 / .25);

    width: max-content;
    min-width: var(--w-field);

    /* Use button element for keyboard accessibility */
    button.search-widget-results-item {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.8rem 1.6rem;
        color: var(--text);
        overflow: hidden;
        text-overflow: ellipsis;

        &:focus {
            outline: unset;
            background-color: var(--fill-highlight);
        }
    }
}

.extra-line-in-table-cell {
    font-style: italic;
}

.prio-rate-script-label,
.warning-in-table-cell {
    margin: 0.5em 0 0 0;
    font-size: var(--fsize-small);
}

.cell-extra {
    margin: 0.5em 0 0 0;
}

/* .spinner class is assigned to existing element with js generated content.
 * For example search-widget-results.
 * We need the pseudo elements before/after for the spinner icon + animation
 */

.spinner::after {
    --mask-size: 1.8rem;

    display: block;
    content: "";
    position: absolute;
    right: 0.8rem;
    top: -2.6rem;
    width: var(--mask-size);
    height: var(--mask-size);

    background-image: var(--icon-spinner);
    background-size: contain;
    animation: animSpinner 1s linear infinite;
}


/* .icon-spinner is a standalone span/div element which can be added as
 * child element to any other element.
 */
.icon-spinner {
    --mask-size: 1.8rem;

    position: relative;
    width: var(--mask-size);
    height: var(--mask-size);

    &::after {
        display: block;
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: var(--mask-size);
        height: var(--mask-size);

        background-image: var(--icon-spinner);
        background-size: contain;
        animation: animSpinner 1s linear infinite;
    }

    .checkbox-column & {
        --mask-size: 1.4rem;

        margin: 0px 20px 0px auto;
    }
}


/* Use right align items in flexbox */
.align-right { margin-left: auto; }

/* Align items on the left if initial position is right */
.align-left { text-align: left; }

form.align-left .btn:first-child { margin-left: 0; }


table.results-spreadsheet {
    font-size: var(--fsize-columns);

    .table-caption {
        font-weight: bold;
        font-style: normal;
    }

    th,
    td {
        border: 0.1rem solid var(--fill-separator-on-tile);
        padding: 0.6rem 1.2rem;

        &:first-child { padding-left: 2.3rem; }
    }

    tbody th,
    thead th {
        font-style: italic;
        font-weight: var(--weight-normal);
    }

    tfoot th {
        font-weight: var(--weight-bold);
    }

    .splitter td {
        /* See CPO charge session reimbursement breakdown. */
        border: none;
        padding: 1rem;
    }
}


table#priced-by-cpo-table {
    /*
     * See roaming partners: a table with aggregate numbers, and a totals footer.
     */

    td:nth-child(1)     { width: 25%; }

    td:nth-child(2),
    td:nth-child(3),
    td:nth-child(4),
    td:nth-child(6),
    td:nth-child(7)     { width: 18%; }

    td:nth-child(5)     { width: 2%; }
}


table#sessions-by-connection-table {
    td:first-child   { width: 33%; }

    td:last-child    { width: 17%; }
}


.hide-label {
    .pioneer-label { display: none; }

    .pioneer-field { padding-top: 0; }
}


.copytoclipboard-component {
    --mask-size: 1.8rem;

    position: relative;

    /* Make sure the block does not go to full 100% width: */
    display: inline-block;

    table > *:first-child > tr:first-child > th:last-child,
    table > *:first-child > tr:first-child > td:last-child {
        padding-right: calc(2 * var(--mask-size));
    }

    .icon-copy {
        display: block;
        width: var(--mask-size);
        height: var(--mask-size);
        background-color: var(--c2c-text);
        mask-image: url("icon-copy.d10a0bfbd382.svg");
        mask-size: var(--mask-size);
    }

    .copytoclipboard-action {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 0.3rem;
        top: 0.3rem;
        width: 2.2rem;
        height: 2.2rem;
        padding: 0;
        border-radius: 0.2rem;
        background-color: var(--c2c-fill);
    }

    .c2c-feedback {
        display: flex;
        visibility: hidden;
        opacity: 0;
        position: absolute;
        top: 0.3rem;
        right: 2.8rem;
        width: unset;
        padding: 0.4rem 0.8rem;
        background-color: var(--c-blue01);
        color: var(--c-grayscale01);
        font-size: 1.14rem;
        border-radius: 0.2rem;

        &::after {
            content: '';
            display: block;
            position: absolute;
            top: 0.7rem;
            right: -0.5rem;
            border-top: 0.36rem solid transparent;
            border-left: 0.6rem solid var(--c-blue01);
            border-bottom: 0.36rem solid transparent;
        }
    }

    &.c2c-copied .c2c-feedback {
        visibility: visible;
        opacity: 1;
        animation: animHideFeedback 0.2s 2.4s forwards;
    }
}

.address-wrapper { max-width: 36rem; }

.extapi-secret,
.token-task-address {
    /* Copy to clipboard button in top right for ext-api secret: */
    margin: 0;
    padding: 1.8rem 2.6rem;
    border: 0.1rem solid var(--extapi-fill);
}


/* C2Clipboard override */
.pubid-oneword {
    .copytoclipboard-action { --c2c-fill: transparent; }

    .c2c-feedback,
    .copytoclipboard-action {
        translate: 0 -0.6rem;
    }

    span.oneword { padding: 0 2.4rem 0 0; }
}


.charts-object {
    /* Leave out margin bottoms so that the padding of .grid-tile does not need
     * compensation.  The real solution is to use margins on all tile content
     * instead.
     */

    /* See grid-tile-header, although this has to compensate for the absence of
     * a tile icon and drop lower:
     */

    margin: 0 0 2.4rem;
    text-align: center; /* the svg image has a display inline-block */

    .grid-tile & {
        margin: 0 4rem;

        &.loading { width: calc(100% - 4.8rem); }

        svg {
            width: 100%;
            height: auto;
        }
    }

    &.loading {
        height: 20rem;
        width: 100%;
        justify-content: center;
        align-items: center;

        svg { translate: 0 calc(var(--scroller-height-mask) * -1); }

        /* Hide when loading the chart */
        + .chart-prev,
        ~ .chart-next { display: none; }

    }

    .legend {
        margin: 1rem 0;
        text-align: left; /* reset from center. */
    }

    .legend-item {
        white-space: nowrap;
        font-size: var(--fsize-small);
        padding-right: 0.4rem;

        svg { transform: translateY(-0.1rem); }
    }

    /* Text and lines ----------------------------------- */
    .gridline { fill: var(--fill-chart-gridline01); }

    .month-label,
    .x-axis-label { fill: var(--fill-chart-label02); }

    .month-line { stroke: var(--fill-chart-gridline02); }

    .y-axis-label { fill: var(--text); }

    .chart-title {
        text-align: left;
        font-size: 2rem; /* see grid-tile-header */
        margin: 0 0 0.4rem 1rem;
    }

    .chart-subtitle {
        text-align: left;
        font-size: var(--fsize-small);
        margin: 0 1rem 0.8rem;
    }
}


form.shortcut-form {
    anchor-name: --shortcut-form;
    position: relative;

    .nothing-found {
        position: absolute;
        top: 0;
        left: 0;
        width: max-content;

        div {
            text-wrap: nowrap;
            visibility: hidden;
            opacity: 0;
            position: absolute;
            right: -100%;
            padding: 0.4rem 0.8rem;
            background-color: var(--c-blue01);
            color: var(--c-grayscale01);
            font-size: 1.14rem;
            border-radius: 0.2rem;

            &::after {
                content: '';
                display: block;
                position: absolute;
                top: 0.7rem;
                right: -0.6rem;
                border-top: 0.36rem solid transparent;
                border-left: 0.6rem solid var(--c-blue01);
                border-bottom: 0.36rem solid transparent;
            }
        }
    }

    &.feedback .nothing-found div {
        visibility: visible;
        opacity: 1;
        animation: animHideFeedback 0.2s 2.4s forwards;
    }
}

.search-popover:popover-open {
    position-anchor: --shortcut-form; /* default anchor */
    top: calc(anchor(top) + 3.2rem);
    left: anchor(left);
    display: grid;
    grid-template-columns: 2rem 1fr;

    /* Fix for safari, which fills the entire viewport */
    grid-template-rows: max-content;
    /* ----- */

    gap: 1.2rem;
    width: 32rem;
    margin: 0;
    padding: 1.6rem;
    background-color: var(--fill-popover);
    border: 0;
    color: var(--text-popover);
    translate: 0 0;
    transition: translate .16s ease-out;
    overflow: visible; /* Needed to show the ::after arrow */

    &::after {
        content: "";
        position: absolute;
        top: -1.2rem;
        left: 0;
        display: block;
        border-top: 1.4rem solid transparent;
        border-left: 1.4rem solid var(--fill-popover);
    }

    @starting-style {
        translate: 0 01.2rem;
    }

    .btn {
        margin: 0.8rem 0 0 0;
        background-color: var(--fill-btn-popover);
        color: var(--text-btn-popover);
    }

    svg {
        --fill-svg-layer1: var(--text-popover);

        width: 2rem;
        height: 2rem;
    }
}

label.shortcut {
    /*
     * Shortcut text input on the homepage for deeplink to e.g. token, evse
     * page.
     */

    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    background: var(--fill-tile);
    /* Slightly higher than the adjacent pills: */
    height: 2.2rem;
    line-height: 2.2rem;
    border-radius: 1.1rem;

    > svg {
        fill: var(--text);
        padding: 0 1px;
        margin: 0 4px 0 8px;
        width: 1.8rem;
    }

    svg:has( + input:placeholder-shown) {
        fill: var(--text-pill);
    }

    > input {
        color: var(--text);
        width: 20ex;
        background: transparent;
        border: 0;
        padding: 0;
        line-height: inherit;
        font-size: var(--fsize-small);
    }

    &:focus {
        color: var(--text);
    }
}

div.library-card {
    position: relative;
    display: inline-block;

    .library-card-edit {
        position: absolute;
        top : 4px;
        right: 0;
    }
}

.fragment-highlighted {
    position: relative;

    &::before {
        position: absolute;
        top: 0.3rem;
        left: -3.34rem;
        content: "";
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        border-radius: 1rem;
        background: url("icon-chevron-right.98d385ca594c.svg") center no-repeat var(--c-deeppink);
        background-size: 1.4rem;
        animation: heartbeat 1.2s ease-in-out 6 both;
    }
}

.column-icon.fragment-highlighted::before,
th.fragment-highlighted::before {
    top: 0rem;
}
.library-card.fragment-highlighted::before {
    top: 0.6rem;
}
tr.fragment-highlighted::before { display: none; }


@keyframes heartbeat {
  0% {
        transform: scale(1);
        transform-origin: center center;
        animation-timing-function: ease-out;
  }
  10% {
        transform: scale(0.91);
        animation-timing-function: ease-in;
  }
  17% {
        transform: scale(0.98);
        animation-timing-function: ease-out;
  }
  33% {
        transform: scale(0.87);
        animation-timing-function: ease-in;
  }
  45% {
        transform: scale(1);
        animation-timing-function: ease-out;
  }
}


@keyframes heartbeat-2 {
  0% {
        transform: scale(1);
        transform-origin: center center;
        animation-timing-function: ease-out;
  }
  10% {
        transform: scale(1.4);
        animation-timing-function: ease-in;
  }
  17% {
        transform: scale(1.26);
        animation-timing-function: ease-out;
  }
  33% {
        transform: scale(1.54);
        animation-timing-function: ease-in;
  }
  45% {
        transform: scale(1);
        animation-timing-function: ease-out;
  }
}


@keyframes animSpinner {
    to {
        transform: rotate(360deg);
    }
}


@keyframes animHideFeedback {
    to {
        visibility: hidden;
        opacity: 0;
    }
}


@keyframes Blink {
    0% {
        transform: scale(1);
    }
    60% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(1);
    }
}


h1 .icon-reports {
    /* The report view; */
    width: 3rem;
    height: 3rem;
}


.outlined-section {
    padding: 3.2rem 4rem 2.4rem;
    border-radius: 0.8rem;
    border: 0.2rem solid var(--fill-outline);
    max-width: 76rem;
    /* width: max-content; */
    width: 100%;
    margin: 2.4rem 0;
    position: relative;

    h2 {
        font-size: 2.4rem;
        margin: 0 0 1.6rem;
        max-width: 48rem;
    }

    .step {
        position: absolute;
        top: 1.2rem;
        right: 1.6rem;
    }

    .message {
        margin-top: 0.8rem;
        padding: 0.6rem 0.8rem;

        .message-icon svg {
            width: 2.4rem;
            height: 2.4rem;
        }
    }
}

#reportview-loader {
    /*
     * Spinning animation on a blue background on a reportview.
     */

    &.loading {
        padding: 1.6rem 2.4rem;
        text-align:center;
    }

    > svg {
        margin: 0 auto;
    }
}


.datetime-presets-widget {
    display: flex;
    gap: 0 0.5rem;
}

.datetime-presets {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 0.4rem;
}

.datetime-presets-btn-toggle {
    display: flex;
    padding: 0.2rem;
    height: 1.6rem;
    border-radius: 0.2rem;
    background-color: var(--fill-button);

    svg {
        vertical-align: top;
        width: 1.2rem;
        height: 1.2rem;
        margin: 0;
    }
}

.datetime-presets-list {
    position: absolute;
    top: -0.4rem;
    left: 0;
    min-width: 16rem;
    transform: translateY(3rem);
    font-size: var(--fsize-field);
    background-color: var(--fill-tile);
    padding: 0.8rem 0;
    box-shadow: 0 0 var(--w-bumper) 0 rgb(0 0 0 / .25);

    &[aria-hidden="true"]  { display: none; }

    &[aria-hidden="false"] { display: block; }
}

.datetime-presets-option {
    display: block;
    width: 100%;
    padding: 0.8rem 1.6rem;
    text-align: left;
    color: var(--text);
    font-size: 1.3rem;
    white-space: nowrap;
    background-color: transparent;

    &.selected,
    &:hover { background-color: var(--fill-highlight); }
}


.shortcuts {
    --w-grid: 1.2rem;

    font-size: var(--fsize-small);
    margin-top: 1.2rem;

    /* This thing can have quite a few links, with long non-breaking words,
     * stretching the entire panel wider than any of the "interesting content".
     * min-width .column-detailview min the padding
     */
    max-width: 56rem;

    /* Mostly for EVCO and EVSE IDs. Let's just assume this works for anything
     * here. Using text-overflow would require inline-block which would inhibit
     * this dense layout:
     */
    word-break: break-all;

    line-height: calc(var(--fsize-small) * 1.5);

    a > svg {
        --fill-svg-layer1: var(--text-link);

        width: var(--w-grid);
        height: var(--w-grid);
        vertical-align: middle;
        margin-right:-0.2rem;
    }

    span::after,
    a::after {
        content: "\00a0"
    }
}


.tools-banner > div {
    background: var(--fill-helptext);
    line-height: normal;
    padding: 1.2rem 1.6rem 1.6rem;
    position: relative;
    margin-bottom: 0.2rem;

    a {
        --text-link: var(--text);

        text-decoration: underline;
    }

        &:last-child::before {
            content: '';
            position: absolute;
            bottom: -1.2rem;
            left: 0rem;
            border-top: 1.4rem solid var(--fill-helptext);
            border-right: 1.4rem solid transparent;
        }
}


form.post-link {
    display: contents;

    a {
        cursor: pointer; /* no href attribute. */
    }
}


span.separator-dash + span.separator-dash::before {
    content: "-";
    display: inline-block;
    padding: 0 3pt;
}


.console-track-tool {
    visibility: hidden;
    z-index: 100001;
    display: inline-block;
    position: fixed;
    top: 0;
    right: 0;
    background: #9e3bff;
    color: white;
    font-size: 14px;
    padding: 2px 8px;

    html.show-console-track & {
        visibility: visible;
    }
}

html.show-console-track #nav-form > div,
html.show-console-track .scroll-shadow,
html.show-console-track .console-track-block,
html.show-console-track .table-boarding-pass,
html.show-console-track .console-track {
    outline: dotted 2px #9e3bff;
}


.defunct-bar {
    /* Not sure if this sticker should stay. We don't really have a design for */
    /* it. */
    transform: rotate(-8deg);
    background-color: var(--fill-button);
    color: var(--text);
    padding: 0.5rem 1rem;
}


/* -------------
 * z-index order
 * -------------
 */

.chart-prev,
.chart-next,
.scroll-mask,
.search-widget-results, /* Place dropdown on top of other relative elements */
.datetime-presets-list,
.pubid-overlay              { z-index: 1; }

.nav-dropdown-overlay       { z-index: 2; }

.nav-dropdown               { z-index: 3; }

header.header1              { z-index: 4; }

.frontend-messages          { z-index: 5; }


/* ---------------
 * Dark mode Theme: gradients/images are not supported in light-dark() function
 * ---------------
 */
@media (prefers-color-scheme: dark) {
    :root {
        --gradient-shadow:  linear-gradient(to right, rgb(0 0 0 / 0.25) 0%, rgb(0 0 0 / 0) 100%);
        --gradient-account: linear-gradient(90deg, #c42d53 0%, #ec773d 100%);
        --gradient-spinner: linear-gradient(to bottom, hsl(0 0% 20% / 1) 10%, hsl(0 0% 20% / 0) 100%);

        --img-logo:     url("logo-white.49a585822e2d.svg");
        --icon-spinner: url("icon-spinner-white.f673f68214d7.svg");
    }
}
