/* begin license *
 *
 * "Straatgenoten" is an app for a street as a community
 *
 * All rights reserved.
 *
 * Copyright (C) 2026 Seecr (Seek You Too B.V.) https://seecr.nl
 *
 * This file is part of "Straatgenoten"
 *
 * end license */

/* The layout and styles of wwft-frontend (wwft.css), with "app-" instead of "wwft-";
 * the rest is Bootstrap and SWL. Straatgenoten's own look (Johan, 20 Nov: lighter,
 * softer, a bit more feminine): the fonts and colours below, on top of Bootstrap's
 * variables. */

/* Quicksand (headings) and Nunito (text), variable fonts, served by us
 * (static/vendor/fonts, SIL Open Font License) */
@font-face {
    font-family: "Quicksand";
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url("vendor/fonts/quicksand-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url("vendor/fonts/nunito-latin-wght-normal.woff2") format("woff2-variations");
}

:root,
body {
    /* the colour scheme: the default, "Roze" (a soft rose with an aubergine menu).
     * The other schemes (.theme-* below, model/user.py THEMES) set the same variables;
     * everything below uses only these. On body (not only :root), so that a scheme's
     * class on body also changes what is worked out from them. */
    --app-color-dark: #3b2639;  /* the menu: aubergine */
    --app-color-light: #fbf6f5;  /* the page: blush */
    --app-color-header: #fdf9f8;
    --app-accent: #b8577f;  /* buttons, links, the active things */
    --app-accent-rgb: 184, 87, 127;
    --app-accent-dark: #9c4669;
    --app-accent-darker: #873c5b;
    --app-accent-soft: #f6e4ea;
    --app-accent-border: #dcaabd;  /* outline buttons */
    --app-accent-focus: #dfa9bf;  /* a field's border when it has focus */
    --app-mauve: #8b7383;  /* small, quiet text */
    --app-text: #3a2f38;
    --app-text-rgb: 58, 47, 56;
    --app-quiet-opacity: 0.68;  /* --bs-secondary-color: text at this opacity */
    --app-border: #eadfe2;
    --app-card-border: #f0e6e8;
    --app-input-border: #e6d8dd;
    --app-addon-bg: #fbf3f5;
    --app-btn-light: #f8eff1;
    --app-btn-light-hover: #f1e2e7;
    --app-btn-secondary: #6f5d6a;
    --app-btn-secondary-strong: #4a3946;
    --app-btn-secondary-border: #dccfd5;
    --app-btn-secondary-hover: #f3e8ec;
    --app-btn-secondary-active: #ead9e0;
    --app-menu-text: #fff;
    --app-menu-hover: color-mix(in srgb, #f3b8cf 22%, transparent);
    --app-version: #b9a3b3;
    --app-shadow-rgb: 120, 60, 90;
    --app-logo-bg: #b8577f;  /* the logo (macros.j2 logo) */
    --app-logo-road: #fff;
    --app-logo-house: #f3b8cf;
    --app-map-building: rgb(150, 96, 130);  /* outlines on the map (streetmap.js) */
    --app-map-building-weight: 1.5;
    --app-heading-font: "Quicksand", "Nunito", system-ui, sans-serif;

    --bs-body-font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-font-weight: 400;
    --bs-body-color: var(--app-text);
    --bs-body-color-rgb: var(--app-text-rgb);
    --bs-emphasis-color: var(--app-text);
    --bs-primary: var(--app-accent);
    --bs-primary-rgb: var(--app-accent-rgb);
    --bs-primary-text-emphasis: var(--app-accent-dark);
    --bs-primary-bg-subtle: var(--app-accent-soft);
    --bs-primary-border-subtle: var(--app-accent-border);
    --bs-link-color: var(--app-accent);
    --bs-link-color-rgb: var(--app-accent-rgb);
    --bs-link-hover-color: var(--app-accent-dark);
    --bs-link-hover-color-rgb: var(--app-accent-rgb);
    --bs-secondary-color: rgba(var(--app-text-rgb), var(--app-quiet-opacity));
    --bs-border-color: var(--app-border);
    --bs-border-radius: 0.6rem;
    --bs-border-radius-sm: 0.45rem;
    --bs-border-radius-lg: 0.9rem;
    --bs-box-shadow: 0 0.5rem 1.25rem rgba(var(--app-shadow-rgb), 0.08);
    --bs-box-shadow-sm: 0 0.15rem 0.5rem rgba(var(--app-shadow-rgb), 0.07);
    --bs-focus-ring-color: rgba(var(--app-accent-rgb), 0.25);
}

/* the other colour schemes (model/user.py THEMES; base.j2 puts theme-<name> on body):
 * the same variables as above, nothing else, except for high contrast */
body.theme-blauw {
    --app-map-building: rgb(56, 98, 150);
    --app-color-dark: #1e2a3a;
    --app-color-light: #f4f7fa;
    --app-color-header: #f9fbfc;
    --app-accent: #2f6db5;
    --app-accent-rgb: 47, 109, 181;
    --app-accent-dark: #24578f;
    --app-accent-darker: #1d4775;
    --app-accent-soft: #e3edf8;
    --app-accent-border: #a9c3e3;
    --app-accent-focus: #8fb2dc;
    --app-mauve: #6b7a8c;
    --app-text: #263241;
    --app-text-rgb: 38, 50, 65;
    --app-border: #dde4ec;
    --app-card-border: #e6ebf1;
    --app-input-border: #d5dee8;
    --app-addon-bg: #f1f5f9;
    --app-btn-light: #edf2f7;
    --app-btn-light-hover: #e1e9f2;
    --app-btn-secondary: #5a6878;
    --app-btn-secondary-strong: #36424f;
    --app-btn-secondary-border: #cfd8e2;
    --app-btn-secondary-hover: #e8eef4;
    --app-btn-secondary-active: #dce5ee;
    --app-menu-hover: color-mix(in srgb, #9cc3ee 22%, transparent);
    --app-version: #93a3b5;
    --app-shadow-rgb: 40, 70, 110;
    --app-logo-bg: #2f6db5;
    --app-logo-house: #9cc3ee;
}

body.theme-groen {
    --app-map-building: rgb(52, 110, 78);
    --app-color-dark: #1d3a2e;
    --app-color-light: #f5f8f4;
    --app-color-header: #fafcf9;
    --app-accent: #2e7d57;
    --app-accent-rgb: 46, 125, 87;
    --app-accent-dark: #246646;
    --app-accent-darker: #1d5239;
    --app-accent-soft: #e2f0e8;
    --app-accent-border: #a7cdb8;
    --app-accent-focus: #8fc0a5;
    --app-mauve: #6c7f74;
    --app-text: #26332c;
    --app-text-rgb: 38, 51, 44;
    --app-border: #dde7e0;
    --app-card-border: #e5ede7;
    --app-input-border: #d4e0d8;
    --app-addon-bg: #f0f5f1;
    --app-btn-light: #ebf3ee;
    --app-btn-light-hover: #dfebe3;
    --app-btn-secondary: #5b6c62;
    --app-btn-secondary-strong: #36443c;
    --app-btn-secondary-border: #cdd9d1;
    --app-btn-secondary-hover: #e6efe9;
    --app-btn-secondary-active: #d9e6dd;
    --app-menu-hover: color-mix(in srgb, #a8dcbf 22%, transparent);
    --app-version: #93ab9d;
    --app-shadow-rgb: 40, 90, 60;
    --app-logo-bg: #1f5e43;  /* the first design's logo */
    --app-logo-house: #f2b533;
}

body.theme-zand {
    --app-map-building: rgb(150, 92, 56);
    --app-color-dark: #3a2a20;
    --app-color-light: #fbf7f1;
    --app-color-header: #fdfaf6;
    --app-accent: #b05a2a;
    --app-accent-rgb: 176, 90, 42;
    --app-accent-dark: #944b22;
    --app-accent-darker: #7c3f1d;
    --app-accent-soft: #f6e6db;
    --app-accent-border: #e2b597;
    --app-accent-focus: #dca383;
    --app-mauve: #8a7466;
    --app-text: #3b2f27;
    --app-text-rgb: 59, 47, 39;
    --app-border: #ece1d6;
    --app-card-border: #f0e7de;
    --app-input-border: #e6d9cc;
    --app-addon-bg: #faf3ec;
    --app-btn-light: #f7eee6;
    --app-btn-light-hover: #f0e2d6;
    --app-btn-secondary: #6e5e52;
    --app-btn-secondary-strong: #4a3c32;
    --app-btn-secondary-border: #ddcfc3;
    --app-btn-secondary-hover: #f3e9e0;
    --app-btn-secondary-active: #eadccf;
    --app-menu-hover: color-mix(in srgb, #f2c6a6 22%, transparent);
    --app-version: #b8a393;
    --app-shadow-rgb: 110, 70, 40;
    --app-logo-bg: #b05a2a;
    --app-logo-house: #f2c6a6;
}

/* high contrast, for who sees less well: black on white, a dark blue that reads as
 * well as black (about 11:1 on white), every border and button edge visible, links
 * underlined, a thick ring around what has focus, slightly heavier text */
body.theme-contrast {
    --app-map-building: #000;
    --app-map-building-weight: 2.5;
    --app-color-dark: #000;
    --app-color-light: #fff;
    --app-color-header: #fff;
    --app-accent: #0b3d91;
    --app-accent-rgb: 11, 61, 145;
    --app-accent-dark: #082d6b;
    --app-accent-darker: #061f4a;
    --app-accent-soft: #dce6f7;
    --app-accent-border: #0b3d91;
    --app-accent-focus: #000;
    --app-mauve: #1a1a1a;
    --app-text: #000;
    --app-text-rgb: 0, 0, 0;
    --app-quiet-opacity: 0.85;
    --app-border: #595959;
    --app-card-border: #595959;
    --app-input-border: #000;
    --app-addon-bg: #fff;
    --app-btn-light: #fff;
    --app-btn-light-hover: #e6e6e6;
    --app-btn-secondary: #000;
    --app-btn-secondary-strong: #000;
    --app-btn-secondary-border: #000;
    --app-btn-secondary-hover: #e6e6e6;
    --app-btn-secondary-active: #ccc;
    --app-menu-text: #fff;
    --app-menu-hover: rgba(255, 255, 255, 0.25);
    --app-version: #ccc;
    --app-shadow-rgb: 0, 0, 0;
    --app-logo-bg: #0b3d91;
    --app-logo-house: #ffd400;
    --bs-body-font-weight: 500;
}

body.theme-contrast .btn-light,
body.theme-contrast .btn-outline-secondary {
    --bs-btn-border-color: #000;
    --bs-btn-hover-border-color: #000;
    --bs-btn-color: #000;
    border-width: 2px;
}

body.theme-contrast a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand),
body.theme-contrast .btn-link {
    text-decoration: underline;
}

body.theme-contrast .app-nav li a,
body.theme-contrast .leaflet-bar a,
body.theme-contrast a[role="button"] {
    text-decoration: none !important;
}

body.theme-contrast .app-nav li a.active {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

body.theme-contrast :focus-visible {
    outline: 3px solid #000 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #fff !important;
}

body.theme-contrast .bg-app :focus-visible {
    outline-color: #fff !important;
    box-shadow: 0 0 0 5px #000 !important;
}

body.theme-contrast .form-check-input {
    border: 2px solid #000;
}

body.theme-contrast .app-header,
body.theme-contrast .text-body-secondary {
    color: #1a1a1a !important;
}

body.theme-contrast .table {
    --bs-table-border-color: #595959;
}

body.theme-contrast .modal-content {
    border: 2px solid #000;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.app-brand, .swl-modal h5, .modal-title {
    font-family: var(--app-heading-font);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.shadow {
    box-shadow: var(--bs-box-shadow) !important;
}

.shadow-sm {
    box-shadow: var(--bs-box-shadow-sm) !important;
}

.card {
    --bs-card-border-color: var(--app-card-border);
}

.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: 2rem;  /* soft, pill-shaped */
    --bs-btn-padding-x: 1rem;
}

.btn-group > .btn {
    --bs-btn-border-radius: 2rem;
}

.btn-primary {
    --bs-btn-bg: var(--app-accent);
    --bs-btn-border-color: var(--app-accent);
    --bs-btn-hover-bg: var(--app-accent-dark);
    --bs-btn-hover-border-color: var(--app-accent-dark);
    --bs-btn-active-bg: var(--app-accent-darker);
    --bs-btn-active-border-color: var(--app-accent-darker);
    --bs-btn-disabled-bg: var(--app-accent);
    --bs-btn-disabled-border-color: var(--app-accent);
    --bs-btn-focus-shadow-rgb: var(--app-accent-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--app-accent);
    --bs-btn-border-color: var(--app-accent-border);
    --bs-btn-hover-bg: var(--app-accent);
    --bs-btn-hover-border-color: var(--app-accent);
    --bs-btn-active-bg: var(--app-accent);
    --bs-btn-active-border-color: var(--app-accent);
    --bs-btn-disabled-color: var(--app-accent);
    --bs-btn-focus-shadow-rgb: var(--app-accent-rgb);
}

.btn-outline-secondary {
    --bs-btn-color: var(--app-btn-secondary);
    --bs-btn-border-color: var(--app-btn-secondary-border);
    --bs-btn-hover-bg: var(--app-btn-secondary-hover);
    --bs-btn-hover-color: var(--app-btn-secondary-strong);
    --bs-btn-hover-border-color: var(--app-btn-secondary-border);
    --bs-btn-active-bg: var(--app-btn-secondary-active);
    --bs-btn-active-color: var(--app-btn-secondary-strong);
    --bs-btn-active-border-color: var(--app-btn-secondary-border);
}

.btn-light {
    --bs-btn-bg: var(--app-btn-light);
    --bs-btn-border-color: var(--app-btn-light);
    --bs-btn-hover-bg: var(--app-btn-light-hover);
    --bs-btn-hover-border-color: var(--app-btn-light-hover);
}

.form-control,
.form-select,
.input-group-text {
    border-color: var(--app-input-border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-accent-focus);
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.input-group-text {
    background-color: var(--app-addon-bg);
    color: var(--app-mauve);
}

.form-check-input:checked {
    background-color: var(--app-accent);
    border-color: var(--app-accent);
}

.form-check-input:focus {
    border-color: var(--app-accent-focus);
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.text-bg-primary {
    background-color: var(--app-accent) !important;
}

.list-group-item.active,
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--app-accent);
    border-color: var(--app-accent);
}

.nav-pills .nav-link.active {
    background-color: var(--app-accent);
}

.table {
    --bs-table-hover-bg: rgba(var(--app-accent-rgb), 0.04);
}

.bg-app {
    background-color: var(--app-color-dark) !important;
    color: var(--app-menu-text);
}

.bg-app-light {
    background-color: var(--app-color-light) !important;
    color: var(--app-text);
}

.bg-app-header {
    background-color: var(--app-color-header) !important;
}

.app-header {
    text-transform: uppercase !important;
    font-weight: 600 !important;
    font-size: 78% !important;
    letter-spacing: 0.06em;
    color: var(--app-mauve) !important;
    vertical-align: middle;
}

.app-scrollable {
    overflow: auto;
}

/* the menu (page.j2) */
.app-nav {
    color: var(--app-menu-text);
}

.app-nav li a {
    color: var(--app-menu-text);
    text-decoration: none;
    width: 100%;
    display: block;
    border-radius: 5px;
    padding: 8px 5px;
}

.app-nav li a.active,
.app-nav li a:hover {
    background: var(--app-menu-hover);
}

.app-nav li a {
    border-radius: 2rem !important;
    padding-left: 0.75rem !important;
}

.app-nav li a div i {
    width: 25px;
    text-align: center;
}

/* a street's or section's name above its screens (menu.py, step 11) */
.app-nav li.app-menu-heading {
    margin-top: 0.75rem;
}

.app-nav li.app-menu-heading:first-child {
    margin-top: 0;
}

.app-nav li.app-menu-heading a {
    font-family: "Quicksand", sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.75;
}

.app-brand {
    color: var(--app-menu-text);
    font-weight: 600;
    letter-spacing: 0.04em;
    font-size: 1.15rem;
}

/* the version at the bottom of the menu (page.j2) */
.app-version {
    color: var(--app-version);
}

nav.navbar {
    font-size: 14px;
}

/* the top bar (page.j2): Beheer and the account menu side by side, also on a narrow
 * screen, their menus over the page */
.app-topbar .dropdown-menu {
    position: absolute;
}

/* in the dark bar on a narrow screen: a long name is cut off */
.bg-app .app-topbar {
    min-width: 0;
}

.bg-app .app-topbar .nav-item {
    min-width: 0;
}

.bg-app .app-topbar .nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    color: var(--app-menu-text);
}

.app-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 10rem;
}

.app-menu-button {
    display: flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
}

/* a table column as narrow as its content (e.g. the buttons) */
.table td.fit,
.table th.fit {
    white-space: nowrap;
    width: 1%;
}

/* a long description on one line, cut off (streets/list.j2) */
.app-description {
    max-width: 30rem;
}

/* "Opgeslagen" after a save (swl's saved()) */
.swl-saved {
    color: var(--bs-success);
    font-size: 0.875em;
    font-weight: 600;
}

/* the streets found at PDOK while adding a street (streets/suggestions.j2) */
.street-suggestions .list-group {
    max-height: 18rem;
    overflow-y: auto;
}

.street-suggestion {
    min-height: 44px;
    cursor: pointer;
}

/* the log of a map build (street/builds.j2) */
.build-log {
    max-height: 16rem;
    overflow: auto;
    font-size: 0.8rem;
    background: var(--bs-tertiary-bg);
    padding: 0.5rem;
    border-radius: 0.25rem;
    white-space: pre-wrap;
}

.build-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

/* an address with its switch (street/addresses_list.j2): a large enough target */
.address-row {
    min-height: 44px;
}

.address-row .form-switch .form-check-input {
    width: 2.75em;
    height: 1.5em;
    cursor: pointer;
}

/* a street's map (street/map.j2, streetmap.js); streetmap.js sets the height */
.street-map-wrap {
    position: relative;
    min-height: 320px;
}

.street-map {
    position: absolute;
    inset: 0;
    border-radius: 0.375rem;
}

.street-map.leaflet-container {
    background: #f2efe9;  /* outside the build's area: no tiles */
    font-family: var(--bs-body-font-family);
}

/* the addresses of the tapped building: on the right, on a phone from the bottom */
.map-panel {
    position: absolute;
    z-index: 1000;
    top: 0.5rem;
    right: 0.5rem;
    width: 20rem;
    max-height: calc(100% - 1rem);
    overflow: auto;
    background: var(--bs-body-bg);
    border-radius: 0.375rem;
}

@media (max-width: 575.98px) {
    .map-panel {
        /* right under the area when there is room for it, else over the bottom half */
        top: min(50%, var(--area-height, 50%));
        left: 0;
        right: 0;
        width: auto;
        max-height: calc(100% - min(50%, var(--area-height, 50%)));
        border-radius: 0.75rem 0.75rem 0 0;
    }

    /* no taller than the area (streetmap.js sets --area-height); the panel opens under it */
    .street-map {
        bottom: auto;
        height: min(100%, var(--area-height, 100%));
    }

    /* while drawing no panel opens: the map gets all the room, for zooming in */
    #street-map-root.drawing-on .street-map {
        bottom: 0;
        height: auto;
    }
}

.map-panel-close {
    min-width: 44px;
    min-height: 44px;
}

.map-panel .list-group-item,
.street-list .list-group-item,
.street-list-building {
    min-height: 44px;
}

/* an address with its notes (notes/macros.j2) */
.note-address {
    min-height: 36px;
}

.note {
    padding-left: 0.75rem;
    border-left: 3px solid #F2B533;  /* lamp yellow, from the design */
}

.note-text {
    overflow-wrap: anywhere;
}

/* the mark on a building with notes (streetmap.js) */
.note-mark {
    color: #b8860b;
    font-size: 14px;
    line-height: 16px;
    text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}

/* a map build's progress (street/progress.j2); in the streets list its column keeps
 * its width, so the columns do not move when a bar comes or goes */
.street-status {
    width: 14rem;
}

.build-progress {
    min-width: 8rem;
    max-width: 24rem;
}

.build-progress .progress {
    height: 1.1rem;
}

/* inviting someone (people/modal_share.j2) and joining (people/welcome.j2) */
.invite-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.75rem;
    letter-spacing: 0.1em;
}

.invite-link {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow-wrap: anywhere;
}

.invite-code-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.welcome-box {
    width: 100%;
    max-width: 24rem;
}

/* an activity's map (street/map.j2 with an activity, activities/*.j2): the colour of a
 * state (model/activity.py STATES), as streetmap.js colours the buildings */
.state-paid { --state: #2e9e5b; }
.state-unpaid { --state: #f08c00; }
.state-maybe { --state: #f2c12e; }
.state-no { --state: #5c6670; }
.state-none { --state: transparent; }

.map-legend-swatch {
    display: inline-block;
    flex-shrink: 0;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: var(--state);
    border: 1.5px solid color-mix(in srgb, var(--state) 80%, #000);
}

.map-legend-swatch.state-none {
    background: color-mix(in srgb, var(--app-map-building) 12%, transparent);  /* as streetmap.js */
    border-color: color-mix(in srgb, var(--app-map-building) 85%, transparent);
}

/* the legend only with the map, not with the list (important: over d-flex) */
#street-map-root:has(.street-map-wrap[hidden]) .map-legend {
    display: none !important;
}

/* "7/11" on a building with several addresses (streetmap.js) */
.map-badge span {
    display: inline-block;
    transform: translate(-50%, -50%);
    padding: 0 0.3rem;
    border-radius: 0.6rem;
    background: #fff;
    border: 1px solid #5c6670;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
}

.record-note {
    overflow-wrap: anywhere;
}

.activity-description {
    white-space: pre-line;
    max-width: 40rem;
}

/* the list view's filter: only shown with the list, shows only the rows it asks for */
#street-map-root:has(#map-list[hidden]) .activity-filter {
    display: none;
}

#street-map-root:has(#filter-taking-part:checked) .record-row:not([data-state="paid"], [data-state="unpaid"]),
#street-map-root:has(#filter-unpaid:checked) .record-row:not([data-state="unpaid"]),
#street-map-root:has(#filter-none:checked) .record-row:not([data-state="none"]) {
    display: none;
}

.record-none-left {
    display: none;
}

#street-map-root:has(#filter-taking-part:checked) .list-group:not(:has(.record-row[data-state="paid"], .record-row[data-state="unpaid"])) .record-none-left,
#street-map-root:has(#filter-unpaid:checked) .list-group:not(:has(.record-row[data-state="unpaid"])) .record-none-left,
#street-map-root:has(#filter-none:checked) .list-group:not(:has(.record-row[data-state="none"])) .record-none-left {
    display: block;
}

/* a record (activities/modal_record.j2): people and payment only when taking part, how
 * and when only when paid; big enough to tap */
.record-form:not(:has(#taking-part-yes:checked)) .record-yes,
.record-form:not(:has(#record-paid:checked)) .record-paid-details {
    display: none;
}

/* four choices side by side, on a narrow phone two by two */
.record-taking-part,
.activity-filter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.375rem;
}

@media (max-width: 400px) {
    .record-taking-part,
    .activity-filter {
        grid-template-columns: 1fr 1fr;
    }
}

.record-taking-part .btn,
.activity-filter .btn {
    min-height: 44px;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-count-field {
    flex: 1 1 7rem;
    max-width: 11rem;
}

.record-counter {
    flex-wrap: nowrap;
}

.record-counter .btn {
    min-width: 44px;
    min-height: 44px;
}

/* the number between − and +: room for two digits, without the browser's arrows */
.record-counter input {
    min-width: 2rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

.record-counter input::-webkit-inner-spin-button,
.record-counter input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* how and when paid: side by side, below each other when there is no room */
.record-paid-field {
    flex: 1 1 9rem;
}

/* changing a record (activities/macros.j2): a finger-sized button */
.record-edit {
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
}

.record-paid .form-check-input {
    width: 2.75em;
    height: 1.5em;
}

.record-paid .form-check-label {
    padding-top: 0.2em;
    padding-left: 0.4em;
}

/* where the money of a payment went: a line of its own */
.record-paid-place {
    flex: 1 1 100%;
}

/* the cash book (cashbook/main.j2, book.j2) */
.cashbook-buttons .btn {
    min-height: 44px;
}

.cashbook-filters .form-select {
    width: auto;
    flex: 1 1 8rem;
    min-height: 44px;
}

.cashbook-line {
    min-height: 44px;
}

.cashbook-amount {
    font-variant-numeric: tabular-nums;
}

.cashbook-income,
.cashbook-payment {
    color: var(--bs-success-text-emphasis);
}

.cashbook-expense {
    color: var(--bs-danger-text-emphasis);
}

.cashbook-places {
    min-height: 44px;
    white-space: nowrap;
}

/* the photo of an entry's receipt in its dialog (cashbook/modal_entry.j2) */
.entry-receipt img {
    width: 88px;
    height: 88px;
    object-fit: cover;
}

.cashbook-export .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* the help of a page (help/base.j2) */
.app-help-text h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.1rem;
    margin-bottom: 0.35rem;
}

.app-help-text p:last-child,
.app-help-text ul:last-child {
    margin-bottom: 0;
}

.app-help {
    cursor: pointer;
}

/* the cash book's buttons: a sign and a coin, no words */
.cashbook-buttons .btn {
    min-width: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font-size: 1.15rem;
}

/* a euro coin (Bootstrap's bi-coin has a dollar): € in a circle, as big as an icon */
.coin-euro {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05em;
    height: 1.05em;
    border: 0.09em solid currentColor;
    border-radius: 50%;
    line-height: 1;
    vertical-align: -0.15em;
}

.coin-euro .bi {
    font-size: 0.68em;
}

/* the front page (news/main.j2, list.j2) */
.news-page {
    max-width: 48rem;
}

.news-add {
    min-width: 56px;
    min-height: 44px;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.news-menu {
    min-width: 44px;
    min-height: 44px;
}

.news-pinned {
    border-color: var(--bs-primary-border-subtle);
}

.news-photo {
    max-height: 22rem;
    object-fit: cover;
}

.news-text {
    overflow-wrap: anywhere;
}

/* an activity's to-dos and meetings (activities/plan.j2) */
.task-tick {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.task-open {
    min-height: 44px;
}

.task-done .task-text {
    text-decoration: line-through;
    color: var(--bs-secondary-color);
}

.task-people .btn,
.plan-add,
.meeting-edit {
    min-height: 44px;
}

.meeting-edit {
    min-width: 44px;
}

.meeting-text {
    overflow-wrap: anywhere;
}

/* a street's public news (news/public.j2) */
.public-login-button {
    min-height: 44px;
    flex-shrink: 0;
}

/* the activity dialog: the closing date only when residents can sign up */
form:not(:has(#activity-signup-open:checked)) .activity-signup-field {
    display: none;
}

/* the activity dialog: the legend text only when the map is shared */
form:not(:has(#activity-share-map:checked)) .activity-share-field {
    display: none;
}

/* a house marked on an activity's map shared with residents (streetmap.js "marked") */
.state-marked { --state: #7048e8; }

/* the activity's map shared with residents (activities/resident_activity.j2): as tall
   as the street's area (streetmap.js fit), not the whole screen */
.resident-map .street-map-wrap {
    min-height: 240px;  /* never 0: Leaflet fits the map before fit() sizes it */
}

.resident-map .street-map {
    bottom: 0;
    height: auto;
}

/* routes and labels on an activity's map (static/drawing.js) */
.map-legend-line {
    display: inline-block;
    flex-shrink: 0;
    width: 1.2rem;
    height: 0.3rem;
    border-radius: 0.15rem;
}

.route-point-icon {
    background: none;
    border: 0;
}

.route-point {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--route-color);
    font: bold 12px/1 system-ui, sans-serif;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.route-point.route-start,
.route-point.route-finish {
    border-color: #fff;
    background: #2f9e44;
}

.route-point.route-finish {
    background: #c92a2a;
}

/* a point can be dragged and tapped: on a touch screen a larger target around it */
.leaflet-marker-draggable.route-point-icon::before {
    content: "";
    position: absolute;
    inset: -12px;
}

.map-label-icon {
    background: none;
    border: 0;
    width: 0 !important;
    height: 0 !important;
}

.map-label {
    position: absolute;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    font-weight: 600;
    line-height: 1.1;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff, 0 0 1px #fff;
}

.leaflet-marker-draggable .map-label {
    cursor: move;
    padding: 4px 6px;
    border: 1px dashed rgba(0, 0, 0, 0.35);
    border-radius: 4px;
}

.drawing-controls a {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 1.15rem;
}

.drawing-export-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.drawing-export-menu[hidden] {
    display: none;
}

.drawing-export-menu .btn {
    min-height: 44px;
}

.drawing-bar[hidden] {
    display: none;
}

.drawing-bar .form-select {
    width: auto;
    max-width: 12rem;
}

/* on a phone: Route/Label and Annuleren/Klaar on one row, the route's tools under it */
@media (max-width: 575.98px) {
    .drawing-route-tools {
        order: 3;
        width: 100%;
    }
}

.drawing-bar [hidden] {
    display: none !important;
}

#street-map-root.drawing-on .street-map {
    cursor: crosshair;
}

/* while drawing the activity's heading and the legend fold away: room for the map
   (the bar shows the route's length); back after Klaar or Annuleren */
#street-map-root.drawing-on .street-map-heading,
#street-map-root.drawing-on .map-legend {
    display: none !important;
}

.drawing-dialog {
    width: min(26rem, calc(100vw - 2rem));
    height: fit-content;  /* a modal dialog is fixed from top to bottom: else it stretches */
    max-height: calc(100dvh - 2rem);
    margin: auto;
    border: 0;
}

.drawing-dialog:not([open]) {
    display: none;  /* .card would show it */
}

.drawing-dialog::backdrop {
    background: rgba(0, 0, 0, 0.35);
}

.drawing-swatch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--swatch);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.btn-check:checked + .drawing-swatch {
    background: var(--swatch);
    box-shadow: 0 0 0 3px var(--swatch);
}

.drawing-menu .leaflet-popup-content {
    margin: 8px;
}

.drawing-menu .btn {
    min-height: 44px;
    text-align: left;
}

/* the login boxes (account/login.j2, people/login.j2): on a phone the logo above the
   fields and the box as wide as the screen allows */
@media (max-width: 575.98px) {
    .login-box {
        width: 100%;
        max-width: 24rem;
    }
}

/* a section's houses in its dialog (streets/modal_section.j2): numbers in columns */
.section-houses {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: 0 0.5rem;
    max-height: 16rem;
    overflow-y: auto;
}

.section-houses .form-check {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* the colour schemes in the Account dialog (account/main.j2) */
.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 2rem;
    cursor: pointer;
}

.theme-option:has(input:checked) {
    border-color: var(--app-accent);
    background: var(--app-accent-soft);
}

.theme-swatches {
    display: inline-flex;
}

.theme-swatches span {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.25);
    margin-left: -0.3rem;
}

.theme-swatches span:first-child {
    margin-left: 0;
}

/* the logo (logo.j2) in the scheme's colours */
.app-logo .logo-bg { fill: var(--app-logo-bg); }
.app-logo .logo-road { stroke: var(--app-logo-road); }
.app-logo .logo-dashes { stroke: var(--app-logo-bg); }
.app-logo .logo-house { fill: var(--app-logo-house); }

/* the map in a section's dialog (streets/modal_section.j2): the fields stay in reach */
.section-pick-map .street-map-wrap {
    max-height: 50vh;
}

.section-pick-map .street-map,
.section-pick-map .street-map.leaflet-container {
    bottom: 0;
    height: auto;  /* not the map page's phone rule (--area-height): no band under it */
}

/* safe areas: opened from a phone's home screen (base.j2: viewport-fit=cover, the
 * status bar black-translucent) the page runs under the phone's status bar, its
 * rounded corners and the bar at the bottom. The page keeps out of them; the strip
 * under the status bar is the menu's colour, so its white clock can be read. In a
 * browser these are all 0. */
body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0
        env(safe-area-inset-left);
}

/* the page scrolls under the bar at the bottom, but its end stays above it */
.app-scrollable,
.news-page {
    padding-bottom: env(safe-area-inset-bottom);
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background: var(--app-color-dark);
    z-index: 1044;  /* under the menu (offcanvas) and dialogs */
}

@media (max-width: 991.98px) {
    #sidebar.offcanvas-lg {
        padding-top: calc(1rem + env(safe-area-inset-top)) !important;
        padding-left: calc(1rem + env(safe-area-inset-left)) !important;
    }
}

.modal {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}
