/*
 * The panel's own corrections to the framework's styles, not a theme: what
 * an accessibility check found, and the few things the office asked for,
 * each said where it stands.
 *
 * A table cell showing a placeholder ("-", "Geen") used the framework's
 * lightest grey, which reads at a contrast of 2.6:1 on white and fails the
 * 4.5:1 the level AA rule asks for. A placeholder is content, not
 * decoration: "Geen" is the answer to the question the column asks. The
 * same grey sits under a placeholder on a record's page ("Zonder
 * onderwerp"), so both are lifted together.
 */
.fi-ta-placeholder,
.fi-in-placeholder {
    color: rgb(82 82 91);
}

.dark .fi-ta-placeholder,
.dark .fi-in-placeholder {
    color: rgb(161 161 170);
}

/*
 * The sidebar navigation scrolls when it is taller than the window, and
 * the bar it shows while doing so sits beside the menu as a permanent
 * grey stripe on most desktops. The office asked for it to go. The list
 * still scrolls with the wheel, a swipe or the keyboard; only the bar is
 * hidden, and the gutter the framework reserves for it with it.
 */
.fi-sidebar-nav {
    scrollbar-width: none;
    scrollbar-gutter: auto;
    -ms-overflow-style: none;
    /* Without a bar, a cut-off list looks finished; the fade says it goes on. */
    mask-image: linear-gradient(to bottom, black calc(100% - 2rem), transparent);
}

.fi-sidebar-nav::-webkit-scrollbar {
    display: none;
}

/*
 * A card's heading gets a ground of its own, so the eye finds where one
 * block ends and the next begins on a page that stacks several. A light
 * blue, quiet enough to leave the slate primary colour the only accent.
 */
.fi-section:not(.fi-section-not-contained):not(.fi-aside) > .fi-section-header {
    background-color: rgb(239 246 255);
    border-start-start-radius: inherit;
    border-start-end-radius: inherit;
}

/* The framework's grey for a heading's description reads at 4.4:1 on the
   tint, under the 4.5:1 the level AA rule asks for; one step darker. */
.fi-section:not(.fi-section-not-contained):not(.fi-aside) > .fi-section-header .fi-section-header-description {
    color: rgb(82 82 91);
}

.dark .fi-section:not(.fi-section-not-contained):not(.fi-aside) > .fi-section-header .fi-section-header-description {
    color: rgb(161 161 170);
}

/* A collapsed card is its heading alone, so the ground rounds off below too. */
.fi-section.fi-collapsed:not(.fi-section-not-contained):not(.fi-aside) > .fi-section-header {
    border-end-start-radius: inherit;
    border-end-end-radius: inherit;
}

.dark .fi-section:not(.fi-section-not-contained):not(.fi-aside) > .fi-section-header {
    background-color: rgb(39 39 42);
    border-bottom: 1px solid rgb(63 63 70);
}

/*
 * The help articles. The package marks them "prose" for a typography
 * plugin nobody here installs, so headings, paragraphs and lists rendered
 * as one grey block a colleague could not read. These are the rules that
 * plugin would have brought, written by hand and kept to what an article
 * needs: a heading that stands out, a paragraph with air, a list with its
 * marks, a table with its lines.
 */
.gu-kb-article {
    max-width: none;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: rgb(39 39 42);
}

.dark .gu-kb-article {
    color: rgb(228 228 231);
}

.gu-kb-article h1 {
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 1rem;
}

.gu-kb-article h2 {
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 600;
    margin: 1.75rem 0 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgb(228 228 231);
}

.dark .gu-kb-article h2 {
    border-top-color: rgb(63 63 70);
}

.gu-kb-article h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.375rem;
}

.gu-kb-article p {
    margin: 0 0 0.875rem;
}

.gu-kb-article ul,
.gu-kb-article ol {
    margin: 0 0 0.875rem;
    padding-inline-start: 1.5rem;
}

.gu-kb-article ul {
    list-style: disc;
}

.gu-kb-article ol {
    list-style: decimal;
}

.gu-kb-article li {
    margin: 0.25rem 0;
}

.gu-kb-article li > p {
    margin: 0;
}

.gu-kb-article strong {
    font-weight: 600;
    color: rgb(24 24 27);
}

.dark .gu-kb-article strong {
    color: rgb(250 250 250);
}

.gu-kb-article a {
    color: rgb(37 99 235);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dark .gu-kb-article a {
    color: rgb(147 197 253);
}

.gu-kb-article code {
    font-size: 0.875em;
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    background-color: rgb(244 244 245);
}

.dark .gu-kb-article code {
    background-color: rgb(39 39 42);
}

.gu-kb-article blockquote {
    margin: 0 0 0.875rem;
    padding-inline-start: 1rem;
    border-inline-start: 3px solid rgb(212 212 216);
    color: rgb(82 82 91);
}

.gu-kb-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1rem;
    font-size: 0.875rem;
}

.gu-kb-article th,
.gu-kb-article td {
    text-align: start;
    vertical-align: top;
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid rgb(228 228 231);
}

.gu-kb-article th {
    font-weight: 600;
    background-color: rgb(250 250 250);
}

.dark .gu-kb-article th,
.dark .gu-kb-article td {
    border-bottom-color: rgb(63 63 70);
}

.dark .gu-kb-article th {
    background-color: rgb(39 39 42);
}

.gu-kb-article hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid rgb(228 228 231);
}

/* The modal and the help page both repeat the article's title as its
   first heading while their own header already carries it, so the
   article's is not needed; and the heading that then comes first should
   not open on a rule. */
.gu-kb-article-modal > h1:first-child,
.gu-kb-article-full > h1:first-child {
    display: none;
}

.gu-kb-article-modal > h1:first-child + *,
.gu-kb-article-full > h1:first-child + * {
    margin-top: 0;
}

.gu-kb-article-modal > h1:first-child + h2,
.gu-kb-article-full > h1:first-child + h2 {
    padding-top: 0;
    border-top: 0;
}

/* A modal is read beside the screen it explains, so its headings stay
   close to the text rather than at the size of a page of their own. */
.gu-kb-article-modal h2 {
    font-size: 1.125rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* The Help button sits in the end of the top bar right before the account
   menu, and the two nearly touched, so the menu keeps its distance. */
html.fi .fi-topbar-end > .fi-user-menu {
    margin-inline-start: 1.5rem;
}

/*
 * The cross that clears a chosen value in a select is drawn 16 pixels
 * square, under the 24 the level AA target-size rule asks for, and sits
 * next to the chevron on a form a packer works through in a hurry. The
 * button grows to 24; the cross inside stays the size it was.
 */
.fi-select-input-value-remove-btn {
    width: 1.5rem;
    height: 1.5rem;
    mask-size: 1rem;
    -webkit-mask-size: 1rem;
}

/*
 * The help package keeps every cell of an article's table on one line, so
 * a table with a long column scrolls sideways on a tablet and the box it
 * scrolls in has no tab stop. Cells wrap instead, a run of joined words
 * (the columns of an import file, written as one code) breaking where it
 * must, so the table fits the screen it is read on.
 */
/* One selector heavier than the package's, which wins on order otherwise. */
.gu-kb-article table tbody {
    white-space: normal;
}

.gu-kb-article td code {
    overflow-wrap: anywhere;
}

/*
 * The top bar stays put while the page scrolls under it. The framework
 * keeps a form field clear of it when the browser scrolls to an error, and
 * nothing else: a link or a button reached by keyboard from further down
 * was scrolled to the very top edge and sat under the bar, focused and
 * unseen. The document keeps that much clear for whatever it scrolls to.
 */
html {
    scroll-padding-top: 5rem;
}

/*
 * Once a photo has been uploaded the upload field laid a green wash over
 * the whole preview and turned the panel behind the file green, which read
 * as a green screen rather than as the photo just chosen. The photo itself
 * is the confirmation: the wash goes and the panel keeps the field's own
 * grey, while the file's name and the remove button stay as they were.
 */
.filepond--image-preview-overlay-success {
    display: none;
}

[data-filepond-item-state='processing-complete'] .filepond--item-panel {
    background-color: #64605e;
}

/*
 * The office asked for a warmer page than the framework's grey: a light sand
 * behind every panel, with cards, tables and forms staying white. On sand
 * the framework's light grey for text that sits straight on the page
 * (breadcrumbs, a page's subheading, the sidebar's group names) reads below
 * the 4.5:1 the level AA rule asks for, so that text is one shade darker.
 * The dark theme keeps the framework's own background.
 */
html.fi:not(.dark) .fi-body {
    background-color: #f6f3ec;
}

html.fi:not(.dark) .fi-breadcrumbs li,
html.fi:not(.dark) .fi-breadcrumbs-item-label,
html.fi:not(.dark) .fi-header-subheading,
html.fi:not(.dark) .fi-sidebar-group-label,
html.fi:not(.dark) .fi-simple-header-subheading {
    color: rgb(82 82 91);
}

/*
 * A list's tabs sit straight on the page rather than in a white bar, so on
 * sand the labels of the tabs not chosen get the same darker grey, and the
 * chosen tab a white pill, since the framework's near-white one disappears
 * against the sand.
 */
html.fi:not(.dark) .fi-tabs:not(.fi-contained) .fi-tabs-item:not(.fi-active) .fi-tabs-item-label {
    color: rgb(82 82 91);
}

html.fi:not(.dark) .fi-tabs:not(.fi-contained) .fi-tabs-item.fi-active {
    background-color: #fff;
}

/*
 * The way back from the portal's help to the portal is a filled button,
 * because a ward reading the help looked for it and did not find it as a
 * plain link: dark on light, light on dark. The framework gives a sidebar
 * link a pale background on hover and on keyboard focus and no outline,
 * which under white text would leave the label unreadable and the focus
 * invisible, so both states are set here: a lighter fill on hover and a
 * ring around the button on focus, readable in either mode.
 */
.wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn {
    background-color: var(--gray-900);
}

.wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn:hover,
.wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn:focus-visible {
    background-color: var(--gray-700);
}

.wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn:focus-visible {
    outline: 2px solid var(--gray-900);
    outline-offset: 2px;
}

.wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn :is(.fi-sidebar-item-label, .fi-icon) {
    color: #fff;
}

.dark .wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn {
    background-color: #fff;
}

.dark .wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn:hover,
.dark .wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn:focus-visible {
    background-color: var(--gray-200);
}

.dark .wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn:focus-visible {
    outline-color: #fff;
}

.dark .wolkos-help-back-prominent .fi-sidebar-item .fi-sidebar-item-btn :is(.fi-sidebar-item-label, .fi-icon) {
    color: var(--gray-950);
}

/*
 * The overview's chart colours, each a step checked for colour blindness
 * and for three to one against a white card: one orange pair for the falls (hard dark,
 * soft light), blue for wolks used, aqua for hours worn, a warm grey for
 * the period before. The dark theme has its own steps, not a flipped light.
 */
:root {
    --wolk-chart-hard: #9e3c15;
    --wolk-chart-soft: #d0662f;
    --wolk-chart-used: #2a78d6;
    --wolk-chart-worn: #169a6b;
    --wolk-chart-previous: #99948a;
    --wolk-chart-without-airbag: #6b4fb8;
    --wolk-chart-battery: #2a78d6;
    --wolk-status-good: #0ca30c;
    --wolk-status-warning: #fab219;
    --wolk-status-serious: #ec835a;
    --wolk-status-critical: #d03b3b;
    --wolk-status-neutral: #8a877f;
}

.dark {
    --wolk-chart-hard: #e0703f;
    --wolk-chart-soft: #f4b08e;
    --wolk-chart-used: #3987e5;
    --wolk-chart-worn: #199e70;
    --wolk-chart-previous: #6b6860;
    --wolk-chart-without-airbag: #9479dd;
    --wolk-chart-battery: #3987e5;
    --wolk-status-neutral: #a3a097;
}

/*
 * The overview's row of filters. On a wide screen it stays under the top
 * bar while the page scrolls, on the page's own sand; on a phone or a
 * tablet, even one held sideways, it scrolls away with the page, since a stuck bar of several
 * fields would cover most of a small screen and the field in focus.
 * Whatever a figure links to is kept clear of both bars.
 */
.wolk-filter-bar {
    padding-block: 0.5rem;
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    /* Whatever the keyboard reaches is kept clear of both bars too. */
    html:has(.wolk-filter-bar) {
        scroll-padding-top: 10rem;
    }

    .wolk-filter-bar {
        position: sticky;
        top: 4rem;
        z-index: 10;
        background-color: #f6f3ec;
        border-bottom: 1px solid rgb(0 0 0 / 0.06);
    }

    .dark .wolk-filter-bar {
        background-color: var(--gray-950, #030712);
        border-bottom-color: rgb(255 255 255 / 0.08);
    }

    #gedragen, #draaguren, #vraagt-aandacht, #wolk-uren, #wolk-stappen, #vallen, #vallen-lijst,
    #office-gedragen, #office-draaguren, #office-vallen {
        scroll-margin-top: 10rem;
    }
}
