/* Boiling Flask components and shell (spec 11.3 to 11.6, direction "A. Soft sidebar").
 * Colours, shadows and radii come only from var(--bf-*) in tokens.css; tests forbid raw colours here.
 *
 *  1. Base            6. Pills and badges     11. Kanban
 *  2. Shell layout    7. Cards                12. Modal
 *  3. Sidebar         8. Forms and alerts     13. Login and error pages
 *  4. Top bar         9. Search pill          14. Phones, tablets, touch
 *  5. Page and        10. List                15. Reduced motion
 *     buttons
 */

/* ===================================================================== 1. Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Component display rules must never un-hide an element marked hidden. */
[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bf-bg);
    color: var(--bf-text);
    font-family: var(--bf-font);
    font-size: 14px;
    line-height: 1.5;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg {
    display: block;
}

a {
    color: var(--bf-primary-hover);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.25;
}

:focus-visible {
    outline: 2px solid var(--bf-primary);
    outline-offset: 2px;
}

::selection {
    background: var(--bf-primary-soft-strong);
}

.bf-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bf-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.bf-skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: var(--bf-radius-sm);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-raised);
}
.bf-skip:focus {
    top: 12px;
}

.bf-muted {
    color: var(--bf-text-muted);
}

details > summary {
    list-style: none;
    cursor: pointer;
}
details > summary::-webkit-details-marker {
    display: none;
}

/* ===================================================================== 2. Shell layout */
/* Sidebar full height at the left, top bar and page in the column to its right. */
.bf-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.bf-main-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bf-main {
    flex: 1;
    width: 100%;
    max-width: 1600px;
    padding: 20px var(--bf-space-page) var(--bf-space-page);
}

.bf-backdrop {
    display: none;
}

/* ===================================================================== 3. Sidebar */
.bf-sidebar {
    position: sticky;
    top: 0;
    z-index: 20; /* the edge pill overlaps the page column */
    display: flex;
    flex-direction: column;
    width: var(--bf-sidebar-width);
    height: 100vh;
    height: 100dvh;
    padding: 0 10px 12px;
    background: var(--bf-primary-soft);
    border-right: 3px solid var(--bf-primary-soft-strong);
    transition: width var(--bf-slow) var(--bf-ease);
}

/* Product logo as the first row, as tall as the top bar so the two line up. */
.bf-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 var(--bf-navbar-height);
    margin-bottom: 10px;
    padding: 0 6px;
    border-bottom: 1px solid var(--bf-primary-soft-strong);
}
.bf-sidebar-home {
    display: flex;
    align-items: center;
    min-width: 0;
}
.bf-sidebar-logo {
    width: auto;
    height: 34px;
    max-width: 100%;
}
.bf-sidebar-mark {
    display: none;
    width: 24px;
    height: 34px;
    object-fit: contain;
}
.bf-sidebar .bf-sidebar-close {
    display: none;
}

.bf-sidebar-nav {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.bf-nav-group + .bf-nav-group {
    margin-top: 14px;
}
.bf-nav-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 10px;
    color: var(--bf-text-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.bf-nav-group-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 5px;
    object-fit: contain;
}
.bf-nav-group-title .bf-icon {
    width: 18px;
    height: 18px;
}
.bf-nav-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bf-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    margin-bottom: 2px;
    padding: 0 10px;
    border-radius: var(--bf-radius-sm);
    color: var(--bf-text);
    white-space: nowrap;
    transition: background-color var(--bf-fast) ease, color var(--bf-fast) ease, box-shadow var(--bf-fast) ease;
}
.bf-nav-item .bf-icon {
    width: 24px;
    height: 24px;
    padding: 2px;
    color: var(--bf-text-muted);
    transition: color var(--bf-fast) ease;
}
.bf-nav-item:hover {
    background: var(--bf-primary-soft-strong);
    color: var(--bf-primary-hover);
    text-decoration: none;
}
.bf-nav-item:hover .bf-icon,
.bf-nav-item.is-active .bf-icon {
    color: var(--bf-primary-hover);
}
.bf-nav-item.is-active {
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-card);
    color: var(--bf-primary-hover);
    font-weight: 700;
}
.bf-nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Edge: a 3px full-height strip that tints on hover, with a slim arrow pill straddling it. */
.bf-sidebar-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -9px;
    width: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.bf-sidebar-toggle::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 5px;
    width: 3px;
    background: var(--bf-sidebar-edge);
    opacity: 0;
    transition: opacity var(--bf-fast) ease;
}
.bf-sidebar-toggle:hover::before,
.bf-sidebar-toggle:focus-visible::before {
    opacity: 1;
}
.bf-sidebar-toggle:focus-visible {
    outline: none;
}
.bf-sidebar-pill {
    position: absolute;
    top: 50%;
    left: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 56px;
    margin-top: -28px;
    border: 1px solid var(--bf-primary-soft-strong);
    border-radius: 9px;
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-card);
    color: var(--bf-primary-hover);
    transition: background-color var(--bf-fast) ease, color var(--bf-fast) ease, border-color var(--bf-fast) ease;
}
.bf-sidebar-pill .bf-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.25;
    transition: transform var(--bf-slow) var(--bf-ease);
}
.bf-sidebar-toggle:hover .bf-sidebar-pill,
.bf-sidebar-toggle:focus-visible .bf-sidebar-pill {
    border-color: var(--bf-primary);
    background: var(--bf-primary);
    color: var(--bf-on-primary);
}

/* Collapsed icon rail (tablet and desktop only; phones always use the slide-in menu). */
@media (min-width: 768px) {
    [data-sidebar="collapsed"] .bf-sidebar {
        width: var(--bf-sidebar-width-collapsed);
    }
    [data-sidebar="collapsed"] .bf-sidebar-logo,
    [data-sidebar="collapsed"] .bf-nav-label,
    [data-sidebar="collapsed"] .bf-nav-group-title > * {
        display: none;
    }
    [data-sidebar="collapsed"] .bf-sidebar-brand {
        justify-content: center;
        padding: 0;
    }
    [data-sidebar="collapsed"] .bf-sidebar-mark {
        display: block;
    }
    [data-sidebar="collapsed"] .bf-nav-group-title {
        height: 1px;
        margin: 0 8px 10px;
        padding: 0;
        background: var(--bf-primary-soft-strong);
    }
    [data-sidebar="collapsed"] .bf-nav-item {
        justify-content: center;
        padding: 0;
    }
    [data-sidebar="collapsed"] .bf-sidebar-pill .bf-icon {
        transform: rotate(180deg);
    }
}

/* ===================================================================== 4. Top bar */
.bf-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--bf-navbar-height);
    padding: 0 var(--bf-space-page);
    background: var(--bf-surface);
    border-bottom: 1px solid var(--bf-border);
    box-shadow: var(--bf-shadow-hairline);
}

.bf-topbar .bf-menu-btn,
.bf-topbar .bf-topbar-mark {
    display: none;
}

.bf-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
}
.bf-breadcrumb-group {
    color: var(--bf-text-muted);
}
.bf-breadcrumb-sep {
    color: var(--bf-border);
}
.bf-breadcrumb-page {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
}

.bf-topbar-end {
    display: flex;
    flex-shrink: 0; /* a long page title in the breadcrumb truncates instead of squeezing these */
    align-items: center;
    gap: 10px;
    margin-left: auto;
    white-space: nowrap;
}

.bf-shop-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border-radius: var(--bf-radius-pill);
    background: var(--bf-bg);
    color: var(--bf-text-muted);
    font-size: 12px;
    font-weight: 600;
}
.bf-shop-chip .bf-icon {
    width: 16px;
    height: 16px;
}

/* User menu: a <details> dropdown (no framework). */
.bf-menu {
    position: relative;
}
.bf-usermenu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 8px 0 4px;
    border-radius: var(--bf-radius-pill);
    transition: background-color var(--bf-fast) ease;
}
.bf-usermenu-toggle:hover,
.bf-menu[open] > .bf-usermenu-toggle {
    background: var(--bf-row-hover);
}
.bf-usermenu-toggle > .bf-icon {
    width: 16px;
    height: 16px;
    color: var(--bf-text-muted);
}
.bf-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: var(--bf-radius-pill);
    background: var(--bf-primary-soft-strong);
    color: var(--bf-primary-hover);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}
.bf-usermenu-who {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.bf-usermenu-name {
    font-size: 13px;
    font-weight: 600;
}
.bf-usermenu-role {
    color: var(--bf-text-muted);
    font-size: 11px;
}

/* Dropdown panel (user menu, search filters). */
.bf-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-hover);
}
.bf-dropdown-end {
    left: auto;
    right: 0;
}
.bf-dropdown-header {
    padding: 8px 10px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--bf-border);
}
.bf-dropdown-header strong {
    display: block;
}
.bf-dropdown-title {
    padding: 8px 10px 4px;
    color: var(--bf-text-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.bf-dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--bf-border);
}
.bf-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--bf-radius-sm);
    background: transparent;
    color: var(--bf-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.bf-dropdown-item .bf-icon {
    width: 18px;
    height: 18px;
    color: var(--bf-text-muted);
}
.bf-dropdown-item:hover,
.bf-dropdown-item:focus-visible {
    background: var(--bf-row-hover);
    color: var(--bf-primary-hover);
    text-decoration: none;
}
.bf-dropdown-item.is-checked {
    font-weight: 600;
}
.bf-dropdown-item.is-checked::after {
    content: "";
    width: 6px;
    height: 10px;
    margin-left: auto;
    border: solid var(--bf-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-2px, -2px);
}
.bf-dropdown form {
    margin: 0;
}

/* Platform owner inside a shop. */
.bf-owner-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px var(--bf-space-page);
    border-bottom: 1px solid var(--bf-warning-border);
    background: var(--bf-warning-soft);
    color: var(--bf-warning);
    font-size: 13px;
    font-weight: 600;
}
.bf-owner-banner .bf-icon {
    width: 18px;
    height: 18px;
}
.bf-owner-banner-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.bf-owner-banner form {
    margin: 0;
}
.bf-owner-banner-lock {
    padding: 2px 8px;
    border: 1px solid var(--bf-warning-border);
    border-radius: 999px;
    font-weight: 700;
}

/* Subscription banner: orange while there is time (trial, plan ending, grace, data-keeping), red once locked. */
.bf-sub-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px var(--bf-space-page);
    border-bottom: 1px solid var(--bf-warning-border);
    background: var(--bf-warning-soft);
    color: var(--bf-warning);
    font-size: 13px;
    font-weight: 600;
}
.bf-sub-banner.is-locked {
    border-bottom-color: var(--bf-danger);
    background: var(--bf-danger);
    color: var(--bf-on-danger);
}
.bf-sub-banner-text {
    flex: 1 1 20rem;
    margin: 0;
}
.bf-sub-banner-btn {
    flex: none;
    padding: 4px 12px;
    border: 1px solid currentColor;
    border-radius: var(--bf-radius-btn);
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.bf-sub-banner-btn:hover {
    background: var(--bf-surface);
    color: var(--bf-text);
}
/* Read-only shop (subscription locked or data-keeping): write controls are greyed and inert (the
   server refuses them anyway), except inside [data-bf-allow-readonly] (the banner, profile, log out,
   deactivating a user). Only the controls themselves are matched, never a container (a form or a
   dialog with hx-post), because pointer-events is inherited: close buttons, links, receipts,
   scrolling, searching and filtering stay usable. */
body.bf-readonly :is(
    button[type=submit],
    button:not([type]),
    input[type=submit],
    :is(button, input, select, textarea, a, label)[hx-post],
    :is(button, input, select, textarea, a, label)[hx-put],
    :is(button, input, select, textarea, a, label)[hx-patch],
    :is(button, input, select, textarea, a, label)[hx-delete]
):is(form[method=post] *, [form], [hx-post], [hx-put], [hx-patch], [hx-delete]):not(
    [data-bf-allow-readonly], [data-bf-allow-readonly] *
) {
    opacity: .45;
    pointer-events: none;
}
.bf-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1100;
    max-width: min(28rem, calc(100vw - 32px));
    padding: 10px 14px;
    border: 1px solid var(--bf-border);
    border-left: 4px solid var(--bf-danger);
    border-radius: var(--bf-radius-sm);
    background: var(--bf-surface);
    color: var(--bf-text);
    box-shadow: var(--bf-shadow-raised);
}
.bf-toast[hidden] {
    display: none;
}

/* ===================================================================== 5. Page and buttons */
/* Control panel: on the page background, on the same grid as the cards below. */
.bf-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: var(--bf-space-gap);
}
.bf-page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.bf-control-search {
    flex: 1 1 320px;
    max-width: 560px;
}
.bf-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}
.bf-page-actions:empty {
    display: none;
}

.bf-stack {
    display: grid;
    gap: var(--bf-space-gap);
}

.bf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-btn);
    background: var(--bf-surface);
    color: var(--bf-text);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--bf-fast) ease, border-color var(--bf-fast) ease,
        color var(--bf-fast) ease, box-shadow var(--bf-fast) ease;
}
.bf-btn .bf-icon {
    width: 18px;
    height: 18px;
}
.bf-btn:hover {
    border-color: var(--bf-primary-soft-strong);
    background: var(--bf-primary-soft);
    color: var(--bf-primary-hover);
    text-decoration: none;
}
.bf-btn:disabled,
.bf-btn[aria-disabled="true"] {
    opacity: .55;
    pointer-events: none;
}
.bf-btn-primary {
    border-color: var(--bf-primary);
    background: var(--bf-primary);
    color: var(--bf-on-primary);
    box-shadow: var(--bf-shadow-primary);
}
.bf-btn-primary:hover,
.bf-btn-primary:active {
    border-color: var(--bf-primary-hover);
    background: var(--bf-primary-hover);
    color: var(--bf-on-primary);
}
.bf-btn-ghost {
    border-color: transparent;
    background: transparent;
}
.bf-btn-danger {
    color: var(--bf-danger);
}
.bf-btn-danger:hover {
    border-color: var(--bf-danger-border);
    background: var(--bf-danger-soft);
    color: var(--bf-danger);
}
.bf-btn-link {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bf-primary-hover);
}
.bf-btn-link:hover {
    border: 0;
    background: transparent;
    text-decoration: underline;
}
.bf-btn-sm {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
}
.bf-btn-block {
    width: 100%;
}

.bf-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--bf-radius-btn);
    background: transparent;
    color: var(--bf-text-muted);
    cursor: pointer;
    transition: background-color var(--bf-fast) ease, color var(--bf-fast) ease;
}
.bf-icon-btn:hover {
    background: var(--bf-row-hover);
    color: var(--bf-primary-hover);
}

/* Tabs (job card "Parts & Services" / "Remarks"). */
.bf-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bf-border);
    overflow-x: auto;
}
.bf-tab {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--bf-text-muted);
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.bf-tab:hover {
    color: var(--bf-primary-hover);
    text-decoration: none;
}
.bf-tab.is-active,
.bf-tab[aria-selected="true"] {
    border-bottom-color: var(--bf-primary);
    color: var(--bf-text);
}

/* ===================================================================== 6. Pills and badges */
.bf-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 10px;
    border-radius: var(--bf-radius-pill);
    background: var(--bf-status-idle);
    color: var(--bf-status-idle-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.bf-pill-open {
    background: var(--bf-status-open);
    color: var(--bf-status-open-text);
}
.bf-pill-assigned {
    background: var(--bf-status-assigned);
    color: var(--bf-status-assigned-text);
}
.bf-pill-progress {
    background: var(--bf-status-progress);
    color: var(--bf-status-progress-text);
}
.bf-pill-done {
    background: var(--bf-status-done);
    color: var(--bf-status-done-text);
}
.bf-pill-cancel {
    background: var(--bf-status-cancel);
    color: var(--bf-status-cancel-text);
}
.bf-pill-primary {
    background: var(--bf-primary-soft-strong);
    color: var(--bf-primary-hover);
}
.bf-pill-success {
    background: var(--bf-success-soft);
    color: var(--bf-success);
}
.bf-pill-warning {
    background: var(--bf-warning-soft);
    color: var(--bf-warning);
}
.bf-pill-danger {
    background: var(--bf-danger-soft);
    color: var(--bf-danger);
}

/* Segmented control (job type, asset mode): outlined pill, the chosen option is tinted with a primary outline. */
.bf-segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-pill);
    background: var(--bf-surface);
}
.bf-segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.bf-segmented label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 16px;
    border-radius: var(--bf-radius-pill);
    color: var(--bf-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--bf-fast) ease, color var(--bf-fast) ease;
}
.bf-segmented label:hover { color: var(--bf-text); }
.bf-segmented input:checked + label {
    background: var(--bf-primary-soft-strong);
    color: var(--bf-primary-hover);
    box-shadow: inset 0 0 0 1px var(--bf-primary);
}
.bf-segmented input:focus-visible + label {
    outline: 2px solid var(--bf-primary);
    outline-offset: 1px;
}

/* ===================================================================== 7. Cards */
.bf-card {
    padding: var(--bf-space-card);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-card);
}
.bf-card-narrow {
    max-width: 560px;
}
.bf-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 16px;
}
.bf-card-title {
    font-size: 16px;
    font-weight: 700;
}
.bf-card-sub {
    margin: 2px 0 0;
    color: var(--bf-text-muted);
    font-size: 13px;
}

.bf-hero {
    display: flex;
    align-items: center;
    gap: 16px;
}
.bf-hero-title {
    font-size: 20px;
    font-weight: 700;
}

/* Quick-link tiles (home). */
.bf-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--bf-space-gap);
}
.bf-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-card);
    color: var(--bf-text);
    transition: box-shadow var(--bf-fast) ease, transform var(--bf-fast) ease;
}
.bf-tile:hover {
    box-shadow: var(--bf-shadow-hover);
    color: var(--bf-text);
    text-decoration: none;
    transform: translateY(-1px);
}
.bf-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--bf-radius-md);
    background: var(--bf-primary-soft);
    color: var(--bf-primary-hover);
}
.bf-tile-label {
    display: block;
    font-weight: 600;
}
.bf-tile-group {
    display: block;
    color: var(--bf-text-muted);
    font-size: 12px;
}
.bf-section-title {
    margin: 8px 0 12px;
    color: var(--bf-text-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.bf-empty {
    padding: 48px 24px;
    color: var(--bf-text-muted);
    text-align: center;
}
.bf-empty img {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: .8;
}
.bf-empty strong {
    display: block;
    margin-bottom: 4px;
    color: var(--bf-text);
    font-size: 15px;
}

/* ===================================================================== 8. Forms and alerts */
.bf-form {
    display: grid;
    gap: 16px;
}
.bf-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}
.bf-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}
.bf-form-row > .bf-field {
    flex: 1 1 200px;
}
.bf-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bf-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.bf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.bf-label {
    color: var(--bf-text-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.bf-help {
    color: var(--bf-text-muted);
    font-size: 12px;
}

.bf-input,
.bf-select,
.bf-textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-btn);
    background: var(--bf-surface);
    color: var(--bf-text);
    font: inherit;
    transition: border-color var(--bf-fast) ease, box-shadow var(--bf-fast) ease;
}
.bf-input-sm {
    width: auto;
    min-height: 32px;
    padding: 4px 10px;
}
.bf-textarea {
    min-height: 6rem;
    resize: vertical;
}
.bf-select {
    padding-right: 32px;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--bf-text-muted) 50%),
        linear-gradient(135deg, var(--bf-text-muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}
.bf-input::placeholder,
.bf-textarea::placeholder {
    color: var(--bf-text-muted);
}
.bf-input:focus,
.bf-select:focus,
.bf-textarea:focus {
    border-color: var(--bf-primary);
    box-shadow: var(--bf-focus-ring);
    outline: none;
}

.bf-input-group {
    position: relative;
    display: flex;
}
.bf-input-group .bf-input {
    padding-right: 48px;
}
.bf-input-addon {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    border: 0;
    border-radius: 0 var(--bf-radius-btn) var(--bf-radius-btn) 0;
    background: transparent;
    color: var(--bf-text-muted);
    cursor: pointer;
}
.bf-input-addon:hover {
    color: var(--bf-primary-hover);
}
.bf-input-addon .bf-icon {
    width: 18px;
    height: 18px;
}
.bf-input-addon[aria-pressed="true"] .bf-icon-show,
.bf-input-addon[aria-pressed="false"] .bf-icon-hide {
    display: none;
}

.bf-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 var(--bf-space-gap);
    padding: 10px 14px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-btn);
    background: var(--bf-surface);
    font-size: 13px;
    font-weight: 500;
}
.bf-alert-danger {
    border-color: var(--bf-danger-border);
    background: var(--bf-danger-soft);
    color: var(--bf-danger);
}
.bf-alert-success {
    border-color: var(--bf-success-border);
    background: var(--bf-success-soft);
    color: var(--bf-success);
}
.bf-alert-warning {
    border-color: var(--bf-warning-border);
    background: var(--bf-warning-soft);
    color: var(--bf-warning);
}

/* ===================================================================== 9. Search pill */
/* Pill-shaped search with facets, and the filter dropdown on its right end. */
.bf-search {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 38px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-pill);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-hairline);
    transition: border-color var(--bf-fast) ease, box-shadow var(--bf-fast) ease;
}
.bf-search:focus-within {
    border-color: var(--bf-primary);
    box-shadow: var(--bf-focus-ring);
}
.bf-search-icon {
    display: flex;
    align-items: center;
    padding-left: 14px;
    color: var(--bf-text-muted);
}
.bf-search-icon .bf-icon {
    width: 18px;
    height: 18px;
}
.bf-search-facets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 5px 0 5px 8px;
}
.bf-facet {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 26px;
    padding: 0 4px 0 10px;
    border-radius: var(--bf-radius-pill);
    background: var(--bf-primary-soft);
    color: var(--bf-primary-hover);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.bf-facet-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: var(--bf-radius-pill);
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.bf-facet-remove:hover {
    background: var(--bf-primary-soft-strong);
}
.bf-facet-remove .bf-icon {
    width: 14px;
    height: 14px;
}
.bf-search-input {
    flex: 1;
    min-width: 120px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--bf-text);
    font: inherit;
    outline: none;
}
.bf-search-input::placeholder {
    color: var(--bf-text-muted);
}
.bf-search-input::-webkit-search-cancel-button {
    display: none;
}
.bf-search-filter {
    position: static;
    display: flex;
}
.bf-search-filter > summary {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 14px 0 12px;
    border-left: 1px solid var(--bf-border);
    border-radius: 0 var(--bf-radius-pill) var(--bf-radius-pill) 0;
    color: var(--bf-text-muted);
    transition: background-color var(--bf-fast) ease, color var(--bf-fast) ease;
}
.bf-search-filter > summary .bf-icon {
    width: 18px;
    height: 18px;
}
.bf-search-filter > summary:hover,
.bf-search-filter[open] > summary {
    background: var(--bf-row-hover);
    color: var(--bf-primary-hover);
}
.bf-search-filter .bf-dropdown {
    left: auto;
    right: 0;
    width: min(320px, calc(100vw - 2 * var(--bf-space-page)));
}

/* ===================================================================== 10. List */
.bf-list {
    overflow: auto;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-card);
}
.bf-list table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.bf-list th,
.bf-list td {
    padding: 12px;
    border-bottom: 1px solid var(--bf-border);
    text-align: left;
    vertical-align: middle;
}
.bf-list th:first-child,
.bf-list td:first-child {
    padding-left: 20px;
}
.bf-list th:last-child,
.bf-list td:last-child {
    padding-right: 20px;
}
.bf-list thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-block: 12px;
    background: var(--bf-surface-muted);
    color: var(--bf-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.bf-list thead th a {
    color: inherit;
}
.bf-list thead th[aria-sort] {
    color: var(--bf-text);
}
.bf-list tbody tr:last-child > * {
    border-bottom: 0;
}
.bf-list tbody tr:hover > td {
    background: var(--bf-row-hover);
}
.bf-list tbody tr.is-selected > td {
    background: var(--bf-primary-soft);
}
.bf-list tbody tr.is-selected:hover > td {
    background: var(--bf-primary-soft-strong);
}
.bf-list tr.bf-group-row > th {
    background: var(--bf-surface-muted);
    color: var(--bf-text);
    font-weight: 600;
}
.bf-list tfoot td {
    border-top: 1px solid var(--bf-border);
    border-bottom: 0;
    font-weight: 600;
}
.bf-list .bf-num {
    text-align: right;
}
.bf-list .bf-actions {
    text-align: right;
    white-space: nowrap;
}
.bf-list .bf-actions .bf-inline-form {
    justify-content: flex-end;
}
.bf-list .bf-inline-form .bf-input-sm {
    min-width: 0;
    flex: 1 1 140px;
}

.bf-pager {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--bf-text-muted);
    font-size: 13px;
}

/* ===================================================================== 11. Kanban */
.bf-kanban {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--bf-space-gap);
}
.bf-kanban > * { min-width: 0; }
.bf-kanban-card {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-card);
    color: var(--bf-text);
    transition: box-shadow var(--bf-fast) ease, transform var(--bf-fast) ease;
}
.bf-kanban-card:hover {
    box-shadow: var(--bf-shadow-hover);
    color: var(--bf-text);
    text-decoration: none;
    transform: translateY(-1px);
}
.bf-kanban-title {
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bf-kanban-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 6px;
    color: var(--bf-text-muted);
    font-size: 13px;
}

/* ===================================================================== 11b. List engine (Task 7)
 * _list.html / _kanban.html / _searchbar.html / _form_*.html. Without ?view= both views render
 * (.bf-view-auto) and the phone default (.bf-phone-kanban) decides below 768px. */
.bf-results {
    display: grid;
    gap: 12px;
    min-width: 0;
}
.bf-col-hidden {
    display: none !important;
}
.bf-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bf-list td.bf-truncate {
    max-width: 22rem;
}
/* Text cells hold their text in a one-track grid. minmax(0, max-content) gives the column a
   minimum width of 0, so the table shrinks long names (ellipsis) to fit its box instead of
   growing past it, yet keeps each name at its natural width when there is room. */
.bf-cell-fit {
    display: grid;
    grid-template-columns: minmax(0, max-content);
}
.bf-cell-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bf-list td a {
    color: var(--bf-text);
    font-weight: 600;
}
.bf-list td a:hover {
    color: var(--bf-primary-hover);
}
.bf-list tr[data-href] {
    cursor: pointer;
}
.bf-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bf-sort:hover {
    color: var(--bf-primary-hover);
    text-decoration: none;
}
.bf-sort-mark {
    font-size: 9px;
}
.bf-group-count {
    color: var(--bf-text-muted);
    font-weight: 500;
}

.bf-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 36px;
}
.bf-list-toolbar-end {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.bf-pager-range {
    padding-right: 4px;
    font-variant-numeric: tabular-nums;
}
.bf-icon-btn[aria-disabled="true"] {
    opacity: .4;
    pointer-events: none;
}
.bf-colpicker > summary .bf-icon {
    width: 16px;
    height: 16px;
}
.bf-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--bf-primary);
}
.bf-view-switch {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-btn);
    background: var(--bf-surface);
}
.bf-view-switch .bf-icon-btn {
    width: 32px;
    height: 30px;
    border-radius: var(--bf-radius-sm);
}
.bf-view-btn[aria-current="true"],
.bf-view-auto .bf-view-btn[data-view="list"] {
    background: var(--bf-primary-soft);
    color: var(--bf-primary-hover);
}
.bf-view-auto .bf-kanban-view {
    display: none;
}

/* Search bar: facet parts and the "Search <field> for: ..." suggestions. */
.bf-facet-label {
    margin-right: 4px;
    font-weight: 500;
    opacity: .8;
}
.bf-facet-text {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bf-search .bf-search-suggest {
    display: none;
    right: 0;
}
.bf-search:focus-within .bf-search-input:not(:placeholder-shown) ~ .bf-search-suggest,
.bf-search .bf-search-input:not(:placeholder-shown) ~ .bf-search-suggest:hover {
    display: block;
}
.bf-search-suggest .bf-dropdown-item {
    gap: 0;
}
.bf-search-suggest strong {
    margin: 0 4px;
}
.bf-search-echo {
    overflow: hidden;
    color: var(--bf-primary-hover);
    font-style: italic;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Kanban parts. */
.bf-kanban-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.bf-kanban-head .bf-kanban-title {
    flex: 1;
    min-width: 0;
}
.bf-kanban-meta .bf-truncate {
    max-width: 100%;
}
.bf-kanban-price {
    margin-top: 8px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.bf-kanban-group + .bf-kanban-group {
    margin-top: 20px;
}
.bf-kanban-group-title {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}
.bf-pill-stock {
    background: var(--bf-status-assigned);
    color: var(--bf-status-assigned-text);
}
.bf-pill-part {
    background: var(--bf-primary-soft-strong);
    color: var(--bf-primary-hover);
}
.bf-pill-service {
    background: var(--bf-warning-soft);
    color: var(--bf-warning);
}

/* Editable list (categories): in-place inputs and the drag handle. */
.bf-list-editable td {
    padding-block: 6px;
}
.bf-handle-cell {
    width: 52px;
}
.bf-list .bf-handle-cell {
    padding-right: 0;
}
.bf-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--bf-radius-sm);
    background: transparent;
    color: var(--bf-text-muted);
    cursor: grab;
    touch-action: none; /* the pointer drags the row instead of scrolling the page */
}
.bf-drag-handle:hover {
    background: var(--bf-row-hover);
    color: var(--bf-primary-hover);
}
.bf-drag-handle:active {
    cursor: grabbing;
}
.bf-list tbody tr.is-dragging > td {
    background: var(--bf-primary-soft);
    box-shadow: var(--bf-shadow-hairline);
}
.bf-input.bf-input-inplace {
    flex: 1 1 200px;
    max-width: 28rem;
    border-color: transparent;
    background: transparent;
}
.bf-input.bf-input-inplace:hover {
    border-color: var(--bf-border);
}
.bf-input.bf-input-inplace:focus {
    border-color: var(--bf-primary);
    background: var(--bf-surface);
}

/* ===================================================================== 11c. Record forms */
.bf-page-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bf-form-page {
    display: grid;
    gap: var(--bf-space-gap);
    max-width: 1040px;
}
.bf-record {
    padding: var(--bf-space-card);
}
.bf-form-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px 40px;
}
.bf-form-group {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.bf-form-group-title {
    float: left; /* lets a <legend> join the grid flow */
    width: 100%;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bf-border);
    color: var(--bf-text-label);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.bf-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.bf-input-row .bf-input {
    flex: 1;
    min-width: 0;
}
.bf-input-prefix {
    color: var(--bf-text-muted);
    font-weight: 600;
}
.bf-value {
    min-height: 38px;
    padding: 8px 0;
}
.bf-price {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.bf-field-error {
    color: var(--bf-danger);
    font-size: 12px;
    font-weight: 500;
}
.bf-input[aria-invalid="true"],
.bf-select[aria-invalid="true"] {
    border-color: var(--bf-danger);
}
.bf-smart-buttons,
.bf-record-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.bf-smart-buttons:empty {
    display: none;
}

/* Toggle switch ("Company"). */
.bf-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    cursor: pointer;
}
.bf-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.bf-switch-track {
    position: relative;
    flex: none;
    width: 38px;
    height: 22px;
    border-radius: var(--bf-radius-pill);
    background: var(--bf-status-idle);
    transition: background-color var(--bf-fast) ease;
}
.bf-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: var(--bf-radius-pill);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-hairline);
    transition: transform var(--bf-fast) ease;
}
.bf-switch input:checked + .bf-switch-track {
    background: var(--bf-primary);
}
.bf-switch input:checked + .bf-switch-track::after {
    transform: translateX(16px);
}
.bf-switch input:focus-visible + .bf-switch-track {
    box-shadow: var(--bf-focus-ring);
}
.bf-switch input:disabled + .bf-switch-track {
    opacity: .6;
}
.bf-switch-label {
    font-weight: 600;
}

@media (max-width: 1023.98px) {
    .bf-view-auto.bf-phone-kanban .bf-list-view,
    .bf-view-auto.bf-phone-kanban .bf-colpicker {
        display: none;
    }
    .bf-view-auto.bf-phone-kanban .bf-kanban-view {
        display: block;
    }
    .bf-view-auto.bf-phone-kanban .bf-view-btn[data-view="list"] {
        background: transparent;
        color: var(--bf-text-muted);
    }
    .bf-view-auto.bf-phone-kanban .bf-view-btn[data-view="kanban"] {
        background: var(--bf-primary-soft);
        color: var(--bf-primary-hover);
    }
}
@media (max-width: 767.98px) {
    .bf-colpicker-label {
        display: none;
    }
    .bf-list td.bf-truncate {
        max-width: 60vw;
    }
    .bf-form-page .bf-record {
        padding: 16px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .bf-drag-handle,
    .bf-view-switch .bf-icon-btn {
        width: 44px;
        height: 44px;
    }
    .bf-check {
        min-height: 44px;
    }
}

/* ===================================================================== 12. Modal */
.bf-modal {
    width: min(800px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-raised);
    color: var(--bf-text);
}
.bf-modal[open] {
    display: flex;
    flex-direction: column;
}
.bf-modal::backdrop {
    background: var(--bf-backdrop);
}
.bf-modal-sm {
    width: min(480px, calc(100vw - 32px));
}
.bf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px var(--bf-space-card);
    border-bottom: 1px solid var(--bf-border);
}
.bf-modal-title {
    font-size: 17px;
    font-weight: 700;
}
.bf-modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px var(--bf-space-card);
}
.bf-modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px var(--bf-space-card);
    border-top: 1px solid var(--bf-border);
}
/* Job card dialog: muted header and footer bands. */
.bf-modal-banded .bf-modal-header,
.bf-modal-banded .bf-modal-footer {
    background: var(--bf-surface-muted);
}

/* ===================================================================== 13. Login and error pages */
/* Centered paper card over the full-bleed desert scene, with a primary glow at the top right. */
.bf-login {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: radial-gradient(900px 400px at 100% 0%, var(--bf-login-glow) 0%, transparent 60%), var(--bf-bg);
}
.bf-login::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("../img/login_scene_calm.svg") center bottom / cover no-repeat;
    opacity: var(--bf-login-scene-opacity);
    pointer-events: none;
}
/* px per scene unit, matches the cover-sized scene image (used to place the smoke) */
.bf-login {
    --u: max(100vw / 1600, 100dvh / 900);
}

/* The exhaust plume: a few blurred puffs rise from the RV's vent, positioned in scene units so they
 * stay on the vent however the scene is cropped. Transform and opacity only. */
.bf-smoke {
    position: absolute;
    --sm: .55; /* the plume is drawn small to match the far-away RV */
    left: calc(50% + (271 - 800) * var(--u));
    top: calc(100% - (900 - 506) * var(--u));
    z-index: -1;
    width: 0;
    height: 0;
    pointer-events: none;
}
.bf-smoke i {
    position: absolute;
    left: calc(-22 * var(--u) * var(--sm));
    top: calc(-22 * var(--u) * var(--sm));
    width: calc(44 * var(--u) * var(--sm));
    height: calc(44 * var(--u) * var(--sm));
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--c) 85%, transparent), transparent 70%);
    filter: blur(3px);
    opacity: 0;
    will-change: transform, opacity;
    animation: bf-smoke-rise 7s linear infinite;
}
.bf-smoke i:nth-child(1) { --c: var(--bf-smoke); --dx: 70; --s: 5; animation-delay: 0s; }
.bf-smoke i:nth-child(2) { --c: var(--bf-smoke); --dx: 30; --s: 4.2; animation-delay: -.9s; }
.bf-smoke i:nth-child(3) { --c: var(--bf-smoke-violet); --dx: 110; --s: 5.6; animation-delay: -1.8s; }
.bf-smoke i:nth-child(4) { --c: var(--bf-smoke); --dx: 50; --s: 4.6; animation-delay: -2.7s; }
.bf-smoke i:nth-child(5) { --c: var(--bf-smoke); --dx: 95; --s: 5.2; animation-delay: -3.6s; }
.bf-smoke i:nth-child(6) { --c: var(--bf-smoke-mint); --dx: 20; --s: 4; animation-delay: -4.5s; }
.bf-smoke i:nth-child(7) { --c: var(--bf-smoke); --dx: 85; --s: 5.4; animation-delay: -5.4s; }
.bf-smoke i:nth-child(8) { --c: var(--bf-smoke); --dx: 60; --s: 4.8; animation-delay: -6.3s; }
@keyframes bf-smoke-rise {
    0% { transform: translate(0, 0) scale(.5); opacity: 0; }
    12% { opacity: .85; }
    100% { transform: translate(calc(var(--dx) * var(--sm) * var(--u)), calc(-300 * var(--sm) * var(--u))) scale(var(--s)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .bf-smoke i {
        animation: none;
        opacity: .3;
    }
    .bf-smoke i:nth-child(n + 4) { display: none; }
}

.bf-login-card {
    width: 100%;
    max-width: 360px;
    padding: 36px 18px 32px;
    border: 1px solid var(--bf-login-card-border);
    border-radius: var(--bf-radius-md);
    background: var(--bf-login-card-bg);
    box-shadow: var(--bf-login-card-shadow);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.bf-login-brand {
    margin-bottom: 32px;
    padding-bottom: 8px;
    text-align: center;
}
.bf-login-logo {
    width: auto;
    max-width: 100%;
    max-height: 64px;
    margin: 0 auto;
}
.bf-login .bf-form {
    gap: 18px;
}
.bf-login .bf-field label {
    color: var(--bf-text);
    font-size: 13px;
    font-weight: 600;
}
.bf-login .bf-input {
    min-height: 42px;
    padding: 10px 12px;
    border-color: var(--bf-login-field-border);
    background: var(--bf-login-field-bg);
}
.bf-login .bf-input:focus {
    border-color: var(--bf-primary);
}
.bf-login .bf-btn-primary {
    min-height: 44px;
    margin-top: 6px;
}
.bf-login .bf-alert {
    margin: 0;
}
.bf-error-card {
    text-align: center;
}
.bf-error-card .bf-login-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
}
.bf-error-card h1 {
    margin-bottom: 8px;
    font-size: 20px;
}
.bf-error-card p {
    margin: 0 0 24px;
    color: var(--bf-text-muted);
}

/* Portrait phones and tablets: the 16:9 scene is a full-width strip at the bottom that fades
 * into the page, so the whole RV and the sun stay visible (a cover crop would cut them). */
@media (orientation: portrait) and (max-width: 1199.98px) {
    .bf-login {
        --u: calc(100vw / 1600);
    }
    .bf-smoke {
        left: calc(271 * var(--u));
    }
    .bf-login::before {
        inset: auto 0 0 0;
        aspect-ratio: 16 / 9;
        background-size: 100% auto;
        background-position: center bottom;
        -webkit-mask-image: linear-gradient(to bottom, transparent 0, var(--bf-mask-solid) 45%);
        mask-image: linear-gradient(to bottom, transparent 0, var(--bf-mask-solid) 45%);
    }
}

/* Under 1200px fields and buttons are 48px with 16px text. */
@media (max-width: 1199.98px) {
    .bf-login .bf-input {
        min-height: 48px;
        font-size: 16px;
    }
    .bf-login .bf-btn {
        min-height: 48px;
        font-size: 16px;
    }
    .bf-login .bf-input-addon {
        width: 48px;
    }
}

@media (max-width: 767.98px) {
    .bf-login-card {
        max-width: 420px;
    }
}

/* Tablets: a roomier card and a bigger logo. */
@media (min-width: 768px) and (max-width: 1199.98px) and (min-height: 600px) {
    .bf-login-card {
        max-width: 440px;
        padding: 44px 32px 40px;
    }
    .bf-login-logo {
        max-height: 72px;
    }
}

/* Short screens (landscape phones): top-aligned and tighter. */
@media (max-height: 520px) {
    .bf-login {
        align-items: flex-start;
    }
    .bf-login-card {
        padding: 20px 18px 18px;
    }
    .bf-login-brand {
        margin-bottom: 12px;
        padding-bottom: 0;
    }
    .bf-login-logo {
        max-height: 44px;
    }
    .bf-login .bf-form {
        gap: 12px;
    }
}

/* ===================================================================== 14. Phones, tablets, touch */
/* Phones: no rail; the sidebar becomes a slide-in menu opened from the top bar. */
@media (max-width: 767.98px) {
    .bf-shell {
        grid-template-columns: minmax(0, 1fr);
    }
    .bf-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 50;
        width: min(300px, 86vw);
        padding-left: max(10px, env(safe-area-inset-left));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        border-right: 0;
        box-shadow: var(--bf-shadow-raised);
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform var(--bf-slow) var(--bf-ease), visibility 0s linear var(--bf-slow);
    }
    .bf-menu-open .bf-sidebar {
        transform: none;
        visibility: visible;
        transition: transform var(--bf-slow) var(--bf-ease);
    }
    .bf-sidebar-brand {
        flex-basis: calc(var(--bf-navbar-height) + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
    }
    .bf-sidebar-toggle {
        display: none;
    }
    .bf-sidebar .bf-sidebar-close {
        display: inline-flex;
    }
    .bf-nav-item {
        height: 44px; /* one row per item */
    }
    .bf-menu-open .bf-backdrop {
        position: fixed;
        inset: 0;
        z-index: 45;
        display: block;
        background: var(--bf-backdrop);
    }
    .bf-menu-open body {
        overflow: hidden;
    }

    .bf-topbar {
        gap: 6px;
        height: calc(var(--bf-navbar-height) + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) max(var(--bf-space-page), env(safe-area-inset-right)) 0
            max(4px, env(safe-area-inset-left));
    }
    .bf-topbar .bf-menu-btn {
        display: inline-flex;
        width: 44px;
        height: 44px;
    }
    .bf-topbar .bf-topbar-mark {
        display: block;
        width: 20px;
        height: 28px;
        object-fit: contain;
    }
    .bf-breadcrumb-group,
    .bf-breadcrumb-sep,
    .bf-usermenu-who,
    .bf-shop-chip {
        display: none;
    }
    .bf-main {
        padding: 12px var(--bf-space-page) max(var(--bf-space-page), env(safe-area-inset-bottom));
    }
    .bf-page-title {
        font-size: 20px;
    }
    .bf-control-search {
        flex-basis: 100%;
        max-width: none;
        order: 3;
    }
    .bf-owner-banner-actions {
        margin-left: 0;
    }

    .bf-modal {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    /* iOS Safari zooms into any focused field under 16px. */
    .bf-input,
    .bf-select,
    .bf-textarea,
    .bf-search-input,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px;
    }
    .bf-textarea {
        min-height: 9rem;
    }
}

/* Touch devices (by pointer type, not width: a narrow desktop window keeps desktop sizes). */
@media (hover: none) and (pointer: coarse) {
    .bf-btn,
    .bf-dropdown-item,
    .bf-tab,
    .bf-search,
    .bf-input,
    .bf-select {
        min-height: 44px;
    }
    .bf-btn-sm {
        min-height: 40px;
    }
    .bf-icon-btn {
        width: 44px;
        height: 44px;
    }
    .bf-nav-item {
        height: 44px;
    }
    .bf-list tbody td {
        height: 44px;
    }
    .bf-segmented label {
        min-height: 28px; /* the control is 36px with its padding: the deliberate exception (spec 11.5) */
    }
    .bf-facet-remove {
        width: 28px;
        height: 28px;
    }
}

/* ===================================================================== 15. Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===================================================================== 14. Job card dialog (spec 10.1) */
.bf-card-dialog .bf-card-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.bf-card-header { flex-wrap: wrap; }
.bf-card-header-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bf-card-page .bf-card-dialog { position: static; display: flex; width: 100%; max-width: 800px; max-height: none; margin: 0 auto; }
.bf-card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.bf-coverage { grid-template-columns: 1fr 1fr; }
/* Card rows: every cell starts at the top so conditional fields never push a sibling to the bottom; one control height. */
.bf-card-row { align-items: start; }
.bf-card-row .bf-input,
.bf-card-row .bf-select { height: 38px; min-height: 38px; box-sizing: border-box; }
.bf-card-row .bf-value { display: flex; align-items: center; height: 38px; min-height: 38px; padding: 0; box-sizing: border-box; }
.bf-coverage-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bf-coverage-col .bf-field-toggle { min-height: 38px; justify-content: center; }
.bf-card-dialog .bf-section-title { margin-top: 18px; }
@media (hover: none) and (pointer: coarse) {
    .bf-card-row .bf-input,
    .bf-card-row .bf-select,
    .bf-card-row .bf-value { height: 44px; min-height: 44px; }
}
.bf-textarea { min-height: 9rem; resize: vertical; }
.bf-prewrap { white-space: pre-wrap; }
.bf-locked-notice { margin-bottom: 16px; padding: 12px 14px; border: 1px dashed var(--bf-border-strong, var(--bf-border)); border-radius: var(--bf-radius-md, 10px); color: var(--bf-text-muted); }
.bf-row-cancel td { color: var(--bf-text-muted); opacity: .75; }
.bf-row-overdue td {
    background: color-mix(in srgb, var(--bf-danger) 7%, transparent);
    box-shadow: inset 0 1px 0 var(--bf-danger-border), inset 0 -1px 0 var(--bf-danger-border);
}
.bf-row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bf-danger), inset 0 1px 0 var(--bf-danger-border), inset 0 -1px 0 var(--bf-danger-border); }
[data-sidebar="collapsed"] .bf-main { max-width: none; }
.bf-row-done td { background: color-mix(in srgb, var(--bf-status-open) 55%, transparent); }
.bf-text-danger { color: var(--bf-status-cancel-text); }

/* Status bar: a chevron pipeline. Passed stages are sage with a tick, the current stage is solid, upcoming stages are muted. */
.bf-statusbar { display: flex; margin: 0 4px 0 auto; padding: 0; list-style: none; }
.bf-step {
    --bf-notch: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: -3px;
    padding: 7px calc(var(--bf-notch) + 8px) 7px calc(var(--bf-notch) + 10px);
    background: var(--bf-status-idle);
    color: var(--bf-status-idle-text);
    font-size: 12px;
    font-weight: 600;
    clip-path: polygon(0 0, calc(100% - var(--bf-notch)) 0, 100% 50%, calc(100% - var(--bf-notch)) 100%, 0 100%, var(--bf-notch) 50%);
}
.bf-step:first-child {
    margin-left: 0;
    padding-left: 14px;
    border-radius: var(--bf-radius-sm) 0 0 var(--bf-radius-sm);
    clip-path: polygon(0 0, calc(100% - var(--bf-notch)) 0, 100% 50%, calc(100% - var(--bf-notch)) 100%, 0 100%);
}
.bf-step:last-child {
    padding-right: 16px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, var(--bf-notch) 50%);
}
.bf-step.is-passed { background: var(--bf-status-open); color: var(--bf-status-open-text); }
.bf-step.is-passed::before { content: "\2713"; font-size: 11px; }
.bf-step.is-idle { opacity: .6; }
.bf-step.is-current { font-weight: 700; }
.bf-step.is-current::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bf-step-open.is-current { background: var(--bf-status-progress); color: var(--bf-status-progress-text); }
.bf-step-assigned.is-current { background: var(--bf-status-progress); color: var(--bf-status-progress-text); }
.bf-step-in_progress.is-current { background: var(--bf-status-done); color: var(--bf-status-done-text); }
.bf-step-done.is-current { background: var(--bf-status-done); color: var(--bf-status-done-text); }
.bf-step-cancel.is-current { background: var(--bf-status-cancel); color: var(--bf-status-cancel-text); }

/* Asset picker: one labelled row, mode switch and asset select side by side. */
.bf-asset-row { grid-template-columns: 1fr; }
.bf-asset-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md); background: var(--bf-surface-muted); }
.bf-asset-pick .bf-segmented { flex: none; }
.bf-asset-pick .bf-field { flex: 1 1 220px; margin: 0; }
.bf-asset-pick .bf-field > .bf-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* One-line reasons under a control (AMC not allowed, AMC expired) and the asset link in the read-only coverage. */
.bf-card-hint { margin: 6px 0 0; color: var(--bf-text-muted); font-size: 12px; line-height: 1.4; }
.bf-card-asset-link { align-self: flex-start; }
.bf-asset-row > .bf-field > .bf-segmented { align-self: flex-start; }
/* Card fields needed before Complete (device and serial of an asset-creating card) are marked, not blocked (the form is novalidate). */
.bf-card-row .bf-field:has(.bf-input[required]) > .bf-label::after { content: " *"; color: var(--bf-danger); }

/* Parts & Services lines */
.bf-lines { display: grid; gap: 8px; margin-bottom: 8px; }
.bf-line-head, .bf-line-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 80px 36px; gap: 8px; align-items: center; }
.bf-line-head { color: var(--bf-text-label); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.bf-tab-panel[hidden] { display: none; }

/* Footer: one row on desktop; tray for secondary actions on phones. */
.bf-card-footer { justify-content: space-between; position: relative; }
.bf-footer-start, .bf-footer-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bf-phone-only { display: none; }
.bf-more-tray { display: none; }

@media (max-width: 767px) {
    .bf-card-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; margin: 0; }
    .bf-coverage { grid-template-columns: 1fr; }
    .bf-card-row { grid-template-columns: 1fr; }
    .bf-desktop-only { display: none !important; }
    .bf-phone-only { display: inline-flex; }
    .bf-card-header { position: sticky; top: 0; z-index: 2; background: var(--bf-surface-muted); }
    .bf-statusbar { width: 100%; margin-left: 0; }
    .bf-step { display: none; }
    .bf-step.is-current { display: inline-flex; margin-left: auto; padding: 5px 12px; border-radius: var(--bf-radius-pill); clip-path: none; }
    .bf-line-head { display: none; }
    .bf-line-row { grid-template-columns: 1fr 70px 36px; padding: 10px; border: 1px solid var(--bf-border); border-radius: 10px; }
    .bf-line-row > select, .bf-line-row > input[name="line_description"] { grid-column: 1 / -1; }
    .bf-card-footer { flex-wrap: nowrap; }
    .bf-footer-main { flex: 1; justify-content: flex-end; flex-wrap: nowrap; }
    .bf-more-tray { position: absolute; right: 12px; bottom: 100%; display: none; flex-direction: column; gap: 4px; padding: 8px; background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: 12px; box-shadow: var(--bf-shadow-raised); }
    .bf-more-open .bf-more-tray { display: flex; }
}

/* ===================================================================== 15. Assets and smart buttons */
.bf-smart-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md, 10px); background: var(--bf-surface); color: var(--bf-text); font-weight: 600; text-decoration: none; }
.bf-smart-button:hover { background: var(--bf-row-hover); text-decoration: none; }
.bf-smart-count { color: var(--bf-primary-hover); font-weight: 700; }
.bf-row-overdue td { background: var(--bf-status-cancel); color: var(--bf-status-cancel-text); }
.bf-row-expired td { color: var(--bf-text-muted); opacity: .75; }
.bf-warranty-until[hidden] { display: none; }
.bf-warranty:has(input[name="under_warranty"]:checked) .bf-warranty-until[hidden] { display: block; }

/* ===================================================================== 16. Dashboard (spec 9) */
.bf-dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bf-dash-subtitle { margin: 0; color: var(--bf-text-muted); }
.bf-dash-updated { margin: 2px 0 0; color: var(--bf-text-muted); font-size: 12px; }
.bf-dash-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.bf-dash-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; min-height: 72px; padding: 10px 14px; border: 1px solid var(--bf-border); border-left-width: 4px; border-radius: var(--bf-radius-md, 10px); background: var(--bf-surface); color: var(--bf-text); text-decoration: none; box-shadow: 0 1px 0 var(--bf-border); }
a.bf-dash-card:hover { background: var(--bf-row-hover); text-decoration: none; }
.bf-dash-card:focus-visible, .bf-dash-row:focus-visible { outline: 2px solid var(--bf-primary); outline-offset: 2px; }
.bf-dash-label { grid-column: 1; color: var(--bf-text-label); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.bf-dash-value { grid-column: 2; grid-row: 1 / span 2; justify-self: end; font-size: 26px; font-weight: 700; }
.bf-dash-sub { grid-column: 1; color: var(--bf-text-muted); font-size: 12px; }
.bf-dash-pending { border-left-color: var(--bf-ochre); }
.bf-dash-progress { border-left-color: var(--bf-status-progress); }
.bf-dash-due { border-left-color: var(--bf-danger); }
.bf-dash-present { border-left-color: var(--bf-success); }
.bf-dash-occupied { border-left-color: var(--bf-primary); }
.bf-ring { display: none; }
.bf-dash-panels { display: grid; grid-template-columns: 1fr; gap: 16px; }
.bf-dash-panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.bf-dash-panel-head h2 { margin: 0; font-size: 15px; }
.bf-dash-panel-head span { color: var(--bf-text-muted); font-size: 12px; }
.bf-dash-list { display: grid; max-height: 400px; overflow-y: auto; }
.bf-dash-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 4px; border-bottom: 1px solid var(--bf-border); color: var(--bf-text); text-decoration: none; }
.bf-dash-row:hover { background: var(--bf-row-hover); text-decoration: none; }
.bf-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bf-status-assigned); color: var(--bf-status-assigned-text); font-size: 11px; font-weight: 700; }
.bf-dash-name { flex: 1; min-width: 0; }
.bf-dash-free { color: var(--bf-success); font-weight: 600; }
.bf-dash-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.bf-dash-empty { padding: 12px 4px; }
@media (min-width: 768px) { .bf-dash-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .bf-dash-panels { grid-template-columns: 1fr 1.4fr; } }
@media (min-width: 1200px) { .bf-dash-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1200px) {
    .bf-dash-occupied { grid-template-columns: auto 1fr auto; }
    .bf-dash-occupied .bf-dash-value { grid-column: 2; }
    .bf-dash-occupied .bf-ring { display: block; grid-column: 3; grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--bf-primary) calc(var(--pct) * 1%), var(--bf-status-idle) 0); -webkit-mask: radial-gradient(circle 11px, transparent 98%, CanvasText 100%); mask: radial-gradient(circle 11px, transparent 98%, CanvasText 100%); }
}

/* ===================================================================== 17. Responsive polish (tablet and phone)
 * Card form header: title and close button share the first row; the status bar drops to its own row
 * below 1200px so nothing orphans. Tablet tables use tighter cells so the Status column stays in view. */
.bf-card-header { flex-wrap: wrap; }
.bf-card-header-main { flex: 1 1 auto; min-width: 0; }
.bf-card-header > .bf-icon-btn { order: 2; flex: none; }
@media (max-width: 1199.98px) {
    .bf-card-header .bf-statusbar { order: 3; flex: 1 0 100%; margin-left: 0; }
    .bf-card-header .bf-step { flex: 1 1 0; text-align: center; padding: 6px 8px; }
}
@media (max-width: 767.98px) {
    .bf-card-header .bf-step.is-current { flex: 0 0 auto; margin-left: 0; }
    .bf-card-header .bf-statusbar { justify-content: flex-start; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
    .bf-list th,

    .bf-list th:first-child,
    .bf-list td:first-child { padding-left: 14px; }
    .bf-list th:last-child,
    .bf-list td:last-child { padding-right: 14px; }
    .bf-list td.bf-truncate { max-width: 12rem; }
    .bf-card-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bf-card-dialog { max-width: 100%; }
}

/* Job card: icon Save beside close, Reassign beside the technician. */
/* Prominent Save (green) and Close (red) in the card header. */
.bf-card-header-actions { display: flex; gap: 8px; flex: none; order: 2; margin-left: auto; }
.bf-icon-btn-strong { width: 34px; height: 34px; border: 2px solid currentColor; border-radius: var(--bf-radius-md); }
.bf-icon-btn-strong .bf-icon { width: 20px; height: 20px; stroke-width: 3; }
.bf-icon-btn-save { color: var(--bf-success); background: var(--bf-success-soft); }
.bf-icon-btn-close { color: var(--bf-danger); background: var(--bf-danger-soft); }
.bf-icon-btn-save:hover, .bf-icon-btn-save:focus-visible { background: var(--bf-success); color: var(--bf-on-primary); }
.bf-icon-btn-close:hover, .bf-icon-btn-close:focus-visible { background: var(--bf-danger); color: var(--bf-on-primary); }
.bf-btn .bf-icon { width: 1em; height: 1em; vertical-align: -0.125em; }
.bf-reassign { display: inline-block; margin-left: 6px; vertical-align: middle; }
.bf-reassign > summary { list-style: none; width: 28px; height: 28px; }
.bf-reassign > summary::-webkit-details-marker { display: none; }
.bf-field:has(> .bf-value > .bf-reassign) { position: relative; }
.bf-reassign { position: static; }
.bf-reassign > summary { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
/* Popover under the field so the narrow technician column never squeezes the controls. */
.bf-reassign-body {
  position: absolute; top: 100%; right: 0; z-index: 5; margin-top: 4px; padding: 10px;
  display: flex; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px);
  background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: 10px;
  box-shadow: var(--bf-shadow-hairline);
}
.bf-reassign-body .bf-select { min-width: 9rem; width: auto; }

/* Job card lifecycle log: its own dialog, plus the history buttons on list rows and kanban cards. */
.bf-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bf-history-col { width: 44px; text-align: right; }
.bf-history-btn { width: 32px; height: 32px; }
.bf-history-btn .bf-icon { width: 18px; height: 18px; }
.bf-kanban-item { position: relative; }
.bf-kanban-item {
  padding: 14px 16px 8px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md);
  background: var(--bf-surface); box-shadow: var(--bf-shadow-card);
  transition: box-shadow var(--bf-fast) ease, transform var(--bf-fast) ease;
}
.bf-kanban-item:hover { box-shadow: var(--bf-shadow-hover); transform: translateY(-1px); }
.bf-kanban-item .bf-kanban-card { padding: 0; border: 0; box-shadow: none; background: none; transform: none; }
.bf-kanban-item .bf-kanban-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.bf-kanban-foot-row { position: relative; z-index: 1; pointer-events: none; }
.bf-kanban-foot-row .bf-history-btn, .bf-kanban-foot-row .bf-kanban-tech, .bf-kanban-foot-row .bf-kanban-due { pointer-events: auto; cursor: pointer; }
.bf-kanban-right { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 1 1 0; min-width: 0; }
.bf-kanban-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; min-width: 0; font-size: 13px; min-height: 22px; }
.bf-kanban-due, .bf-kanban-tech { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.bf-kanban-due { color: var(--bf-text-muted); white-space: nowrap; flex: none; }
.bf-kanban-overdue { color: var(--bf-danger); font-weight: 600; }
.bf-kanban-tech { color: var(--bf-text); flex: 0 1 auto; }
.bf-kanban-right .bf-history-btn { flex: none; }
.bf-kanban-tech .bf-icon { color: var(--bf-primary-hover); }
.bf-kanban-due .bf-icon, .bf-kanban-tech .bf-icon { width: 15px; height: 15px; flex: none; }
.bf-kanban-unassigned { color: var(--bf-text-muted); }
.bf-log-dialog { width: min(480px, calc(100vw - 24px)); padding: 0; }
.bf-log-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.bf-log-chip { padding: 6px 10px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-md); background: var(--bf-surface-muted); font-size: 12px; color: var(--bf-text-muted); }
.bf-log-chip b { display: block; font-size: 15px; color: var(--bf-text); }
.bf-log-timeline { --bf-dot: 12px; --bf-rail: 2px; margin: 0; padding: 0; list-style: none; }
.bf-log-timeline li { position: relative; padding: 0 0 14px 30px; }
/* Dot and rail share one 12px column, so the rail runs exactly through each dot's centre. */
.bf-log-timeline li:not(:last-child)::after { content: ""; position: absolute; left: calc((var(--bf-dot) - var(--bf-rail)) / 2); top: calc(var(--bf-dot) + 7px); bottom: -5px; width: var(--bf-rail); background: var(--bf-primary); }
.bf-log-gap::after { top: 0 !important; }
.bf-log-ev::before { content: ""; position: absolute; left: 0; top: 5px; box-sizing: border-box; width: var(--bf-dot); height: var(--bf-dot); border-radius: 50%; background: var(--bf-primary); border: 2px solid var(--bf-primary); }
.bf-log-ev.is-done::before { background: var(--bf-success); border-color: var(--bf-success); }
.bf-log-ev.is-current::before { background: var(--bf-surface); box-shadow: 0 0 0 3px var(--bf-primary-soft); }
.bf-log-gap.is-ahead:not(:last-child)::after { background: var(--bf-border); }
.bf-log-when { font-size: 12px; color: var(--bf-text-muted); }
.bf-log-dur { display: inline-block; padding: 1px 8px; border-radius: var(--bf-radius-pill); background: var(--bf-status-progress); color: var(--bf-status-progress-text); font-size: 12px; }
.bf-log-empty { color: var(--bf-text-muted); }
.bf-log-dialog .bf-modal-body { max-height: 60vh; overflow-y: auto; }

/* Deactivated shop: everything behind the overlay is inert and grey. */
.bf-lock-wrap {
    display: contents;
}
.bf-locked {
    overflow: hidden;
}
.bf-locked .bf-lock-wrap > * {
    filter: grayscale(1);
    opacity: .6;
    pointer-events: none;
    user-select: none;
}
.bf-lock {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--bf-space-gap);
    background: var(--bf-lock-scrim);
}
.bf-lock-card {
    width: 100%;
    max-width: 440px;
    padding: var(--bf-space-card);
    border-radius: var(--bf-radius-lg);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-raised);
    text-align: center;
}
.bf-lock-msg {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--bf-text);
}
.bf-lock-contact {
    margin: 0 0 var(--bf-space-gap);
    color: var(--bf-text-muted);
    overflow-wrap: anywhere;
}
.bf-lock-card form {
    margin: 0;
}

/* ===================================================================== 18. Calendar (calendar spec 5)
 * Header (Week | Month, range, Today), the summary strip, then the technician lanes on wide screens.
 * Date cells carry the load colour; cards are white with a small tag. Lane names stay pinned left
 * while the grid scrolls sideways inside its own wrapper, so the page never scrolls sideways. */
.bf-calendar { min-width: 0; }
.bf-cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.bf-cal-views { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-pill); background: var(--bf-surface); }
.bf-cal-views a { display: inline-flex; align-items: center; min-height: 28px; padding: 0 16px; border-radius: var(--bf-radius-pill); color: var(--bf-text-muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.bf-cal-views a:hover { color: var(--bf-text); text-decoration: none; }
.bf-cal-views a[aria-current] { background: var(--bf-primary-soft-strong); color: var(--bf-primary-hover); box-shadow: inset 0 0 0 1px var(--bf-primary); }
.bf-cal-range { display: inline-flex; align-items: center; gap: 4px; }
.bf-cal-range .bf-icon-btn { font-size: 20px; line-height: 1; text-decoration: none; }
.bf-cal-label { min-width: 9rem; text-align: center; font-weight: 600; }

.bf-cal-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.bf-cal-sum { display: inline-flex; align-items: baseline; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-pill); background: var(--bf-surface); color: var(--bf-text); font-size: 13px; text-decoration: none; }
.bf-cal-sum:hover { background: var(--bf-row-hover); text-decoration: none; }
.bf-cal-sum-n { font-weight: 700; }
.bf-cal-sum-label { color: var(--bf-text-muted); }
.bf-cal-sum-overdue .bf-cal-sum-n { color: var(--bf-danger); }

.bf-cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; color: var(--bf-text-label); font-size: 12px; }
.bf-cal-swatch { display: inline-block; width: 14px; height: 14px; margin-right: 4px; border: 1px solid var(--bf-border); border-radius: 4px; vertical-align: -3px; }

.bf-cal-wide { display: none; }
.bf-cal-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 4px; }
.bf-cal-grid { display: grid; gap: 3px; grid-template-columns: 150px minmax(160px, 1.1fr) repeat(var(--bf-cal-days), minmax(150px, 1fr)); min-width: calc(150px + 160px + var(--bf-cal-days) * 150px + (var(--bf-cal-days) + 1) * 3px); }
.bf-cal-month .bf-cal-grid { grid-template-columns: 130px 56px repeat(var(--bf-cal-days), minmax(38px, 1fr)); min-width: calc(130px + 56px + var(--bf-cal-days) * 38px + (var(--bf-cal-days) + 1) * 3px); }
.bf-cal-row { display: contents; }
.bf-cal-corner, .bf-cal-lane { position: sticky; left: 0; z-index: 2; }
.bf-cal-corner { background: var(--bf-bg); }
.bf-cal-latehead, .bf-cal-dayhead { padding: 4px; border-radius: 6px; color: var(--bf-text-label); font-size: 11px; font-weight: 600; text-align: center; text-transform: uppercase; }
.bf-cal-latehead { color: var(--bf-danger); }
.bf-cal-dayhead-today { background: var(--bf-primary); color: var(--bf-on-primary); }
.bf-cal-lane { min-width: 0; padding: 6px 8px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-sm); background: var(--bf-surface); font-weight: 600; overflow-wrap: anywhere; }
.bf-cal-lane small { display: block; color: var(--bf-text-muted); font-size: 12px; font-weight: 400; }
.bf-cal-archived { color: var(--bf-text-muted); font-weight: 400; }
.bf-cal-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 44px; padding: 4px; border: 1px solid var(--bf-border); border-radius: 6px; background: var(--bf-surface); }
.bf-cal-late { border-style: dashed; border-color: var(--bf-danger-border); }
.bf-load-free { background: var(--bf-load-free); }
.bf-load-ok { background: var(--bf-load-ok); border-color: var(--bf-success-border); }
.bf-load-full { background: var(--bf-load-full); border-color: var(--bf-warning-border); }
.bf-load-past { background: var(--bf-load-past); }
.bf-cal-cell.bf-cal-today { outline: 2px solid var(--bf-primary); outline-offset: -1px; }

.bf-cal-card { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 6px; border: 1px solid var(--bf-border); border-radius: 6px; background: var(--bf-surface); color: var(--bf-text); font-size: 12px; line-height: 1.3; text-decoration: none; box-shadow: var(--bf-shadow-hairline); overflow-wrap: anywhere; cursor: pointer; }
.bf-cal-card:hover { border-color: var(--bf-primary); text-decoration: none; }
.bf-cal-card:focus-visible { outline: 2px solid var(--bf-primary); outline-offset: 1px; }
.bf-cal-card-name { font-weight: 700; }
.bf-cal-card-meta { color: var(--bf-text-muted); }
.bf-cal-tag { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: var(--bf-radius-pill); font-size: 10px; font-weight: 700; letter-spacing: .02em; line-height: 16px; text-transform: uppercase; }
.bf-cal-tag-overdue, .bf-cal-tag-amc_overdue { background: var(--bf-danger-soft); color: var(--bf-danger); }
.bf-cal-tag-in_progress { background: var(--bf-warning-soft); color: var(--bf-warning); }
.bf-cal-tag-done { background: var(--bf-success-soft); color: var(--bf-success); }
.bf-cal-tag-amc { background: var(--bf-primary-soft-strong); color: var(--bf-primary-hover); }

/* Popovers: plain <details>; app.js places the panel in the viewport (position: fixed), so it floats over
   the lane scroller instead of being clipped by it. Hidden until placed so it never flashes at 0,0. */
.bf-cal-pop { position: relative; }
.bf-cal-pop[open]:not([data-bf-placed]) > .bf-cal-pop-panel { visibility: hidden; }
.bf-cal-pop > summary { list-style: none; cursor: pointer; }
.bf-cal-pop > summary::-webkit-details-marker { display: none; }
.bf-cal-pop > summary:focus-visible { outline: 2px solid var(--bf-primary); outline-offset: 1px; }
.bf-cal-pop-panel { position: fixed; top: 0; left: 0; z-index: 30; max-height: calc(100vh - 16px); overflow-y: auto; display: grid; gap: 6px; width: max-content; min-width: 200px; max-width: 280px; padding: 10px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-sm); background: var(--bf-surface); box-shadow: var(--bf-shadow-raised); font-weight: 400; text-align: left; }
.bf-cal-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 12px; }
.bf-cal-facts dt { color: var(--bf-text-label); }
.bf-cal-facts dd { margin: 0; overflow-wrap: anywhere; }
.bf-cal-pop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bf-cal-month .bf-cal-cell { align-items: stretch; justify-content: center; font-size: 12px; font-weight: 700; text-align: center; }
.bf-cal-month .bf-cal-cell > .bf-cal-pop > summary { display: grid; place-items: center; min-height: 34px; }
.bf-cal-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: var(--bf-radius-pill); background: var(--bf-danger); color: var(--bf-on-primary); font-size: 11px; line-height: 18px; }

/* Lanes from 768px; the phone block below that. */
@media (min-width: 768px) {
    .bf-cal-wide { display: block; }
    .bf-cal-narrow { display: none; }
}

/* Phones (calendar spec 6): the manager's day strip + team list, and the diary (every width, centred). */
.bf-cal-diary { max-width: 560px; margin: 0 auto; }
.bf-cal-diary-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.bf-cal-back { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; text-decoration: none; }
.bf-cal-title { flex-basis: 100%; margin: 0; font-size: 18px; }
.bf-cal-sec { display: grid; gap: 6px; margin-bottom: 14px; }
.bf-cal-sechead { display: flex; justify-content: space-between; align-items: baseline; margin: 0; color: var(--bf-text-label); font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; scroll-margin-top: 72px; }
.bf-cal-sechead small { font-weight: 400; text-transform: none; }
.bf-cal-sechead-late { color: var(--bf-danger); }
.bf-cal-narrow .bf-cal-card, .bf-cal-diary .bf-cal-card { padding: 8px 10px; font-size: 13px; }
.bf-cal-card-tech { color: var(--bf-text-label); font-size: 12px; }
.bf-cal-dblock { display: grid; gap: 6px; padding: 6px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-sm); }
.bf-cal-dblock.bf-cal-today { outline: 2px solid var(--bf-primary); outline-offset: -1px; }
.bf-cal-dhead { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; }
.bf-cal-dhead small, .bf-cal-sec .bf-cal-sechead small { color: var(--bf-text-muted); font-weight: 400; }
.bf-cal-more { display: flex; align-items: center; justify-content: center; min-height: 40px; font-weight: 600; text-decoration: none; }

.bf-cal-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
.bf-cal-strip-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 4px 0; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-sm); background: var(--bf-surface); color: var(--bf-text); font-size: 12px; line-height: 1.2; text-decoration: none; }
.bf-cal-strip-day:hover { border-color: var(--bf-primary); text-decoration: none; }
.bf-cal-strip-day .bf-cal-dow { color: var(--bf-text-muted); font-size: 11px; }
.bf-cal-strip-day .bf-cal-dom { font-weight: 700; }
.bf-cal-strip-day.bf-cal-today { border-color: var(--bf-primary); }
.bf-cal-strip-day[aria-current] { background: var(--bf-primary); border-color: var(--bf-primary); color: var(--bf-on-primary); }
.bf-cal-strip-day[aria-current] .bf-cal-dow { color: inherit; }

.bf-cal-trow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-sm); background: var(--bf-surface); color: var(--bf-text); text-decoration: none; }
a.bf-cal-trow:hover { border-color: var(--bf-primary); text-decoration: none; }
.bf-cal-trow-name { min-width: 0; overflow-wrap: anywhere; }
.bf-cal-trow-name small { display: block; color: var(--bf-text-muted); font-size: 12px; }
.bf-cal-trow-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.bf-cal-trow-tags .bf-cal-tag { margin-top: 0; }
.bf-cal-tag-free { background: var(--bf-surface); box-shadow: inset 0 0 0 1px var(--bf-border); color: var(--bf-text-label); }

.bf-cal-banner { display: block; margin-bottom: 8px; padding: 8px 10px; border-radius: var(--bf-radius-sm); background: var(--bf-danger-soft); color: var(--bf-danger); font-weight: 600; text-decoration: none; }
.bf-cal-banner:hover { text-decoration: underline; }
.bf-cal-mini { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 12px; text-align: center; }
.bf-cal-mhead { color: var(--bf-text-label); font-size: 11px; font-weight: 600; }
.bf-cal-mday { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--bf-border); border-radius: 6px; color: var(--bf-text); font-size: 12px; line-height: 1.2; text-decoration: none; }
.bf-cal-mday.bf-load-past { color: var(--bf-text-muted); }
.bf-cal-mday b { font-size: 11px; }
.bf-cal-mday:hover { border-color: var(--bf-primary); text-decoration: none; }
.bf-cal-mday.bf-cal-today { outline: 2px solid var(--bf-primary); outline-offset: -1px; }
.bf-cal-mday[aria-current] { box-shadow: inset 0 0 0 2px var(--bf-primary-hover); font-weight: 700; }

/* Touch targets: 48px tall under 1200px, like the fields and buttons. */
@media (max-width: 1199.98px) {
    .bf-cal-narrow .bf-cal-card, .bf-cal-diary .bf-cal-card, .bf-cal-strip-day, .bf-cal-trow,
    .bf-cal-mday, .bf-cal-more, .bf-cal-back, .bf-cal-banner, .bf-cal-views a, .bf-cal-head > .bf-btn,
    .bf-cal-sum, .bf-cal-wide .bf-cal-card, .bf-cal-month .bf-cal-cell > .bf-cal-pop > summary,
    .bf-cal-pop-actions .bf-btn { min-height: 48px; }
    .bf-cal-range .bf-icon-btn { width: 48px; height: 48px; }
    .bf-cal-head > .bf-btn, .bf-cal-sum, .bf-cal-pop-actions .bf-btn { display: inline-flex; align-items: center; }
    .bf-cal-banner { display: flex; align-items: center; }
}

a.bf-shop-chip {
    text-decoration: none;
}
a.bf-shop-chip:hover {
    color: var(--bf-text);
}

.bf-login-link { margin: var(--bf-space-3, 12px) 0 0; text-align: center; font-size: 0.9rem; }

/* Setup wizard step indicator */
.bf-steps { display: flex; flex-wrap: wrap; gap: var(--bf-space-3, 0.75rem); list-style: none; margin: 0 0 var(--bf-space-3, 0.75rem); padding: 0; color: var(--bf-muted, inherit); }
.bf-steps [aria-current="step"] { font-weight: 600; color: inherit; }

/* Billing page: plan facts, live quote totals, data-keeping plan choice. */
.bf-billing-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 24px; margin: 0; }
.bf-billing-facts dt { color: var(--bf-text-label); font-size: 12px; font-weight: 600; }
.bf-billing-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.bf-billing-facts + .bf-alert { margin: 16px 0 0; }
.bf-billing-hint { font-size: 12px; }
.bf-billing-totals { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; padding: 10px 14px; border-radius: var(--bf-radius-sm); background: var(--bf-surface-muted); }
.bf-billing-plans { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.bf-billing-plan { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--bf-border); border-radius: var(--bf-radius-sm); cursor: pointer; }
.bf-billing-plan:has(input:checked) { border-color: var(--bf-primary); box-shadow: inset 0 0 0 1px var(--bf-primary); }
.bf-billing-plan input { margin-top: 3px; }
.bf-billing-plan-name { margin: 0; min-height: 36px; display: flex; align-items: center; font-weight: 600; }
.bf-billing-autopay-opt { flex-basis: 100%; }
.bf-billing-autopay-opt label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.bf-billing-autopay-opt p { margin: 4px 0 0; }
.bf-billing-autopay-line { margin: 16px 0 0; color: var(--bf-text-label); }

/* Customer picker (_customer_picker.html). One control: a search glass inside the left edge and, on the job
   card, a slim + segment on the right edge, so the field keeps its grid cell. Results and the quick-add card
   float over the form (never in the flow), at least 20rem wide so names read in full even when the field sits
   in a narrow column; on a phone they are capped to the screen. Rows and buttons are 44px+ for thumbs. */
.bf-picker {
    position: relative;
}
.bf-picker-control {
    position: relative;
}
.bf-picker-glass {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 12px;
    display: flex;
    align-items: center;
    color: var(--bf-text-muted);
    pointer-events: none;
}
.bf-picker-glass .bf-icon {
    width: 16px;
    height: 16px;
}
.bf-picker-input {
    min-height: 44px;
    padding-left: 36px;
    text-overflow: ellipsis;
}
.bf-picker-control.has-new .bf-picker-input {
    padding-right: 48px;
}
.bf-picker-input::-webkit-search-cancel-button {
    display: none;
}
.bf-picker-new {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--bf-border);
    border-radius: 0 calc(var(--bf-radius-btn) - 1px) calc(var(--bf-radius-btn) - 1px) 0;
    background: transparent;
    color: var(--bf-primary-hover);
    cursor: pointer;
}
.bf-picker-new .bf-icon {
    width: 18px;
    height: 18px;
}
.bf-picker-new:hover,
.bf-picker-new[aria-expanded="true"] {
    background: var(--bf-primary-soft);
}
.bf-picker-new:focus-visible {
    outline: 2px solid var(--bf-primary);
    outline-offset: -2px;
}
.bf-picker-list,
.bf-picker-quick {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    width: max(100%, 20rem);
    max-width: calc(100vw - 32px);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    background: var(--bf-surface);
    box-shadow: var(--bf-shadow-raised);
}
.bf-picker-list {
    max-height: min(60vh, 24rem);
    overflow-y: auto;
    padding: 4px;
}
.bf-picker-list[hidden],
.bf-picker-quick[hidden] {
    display: none;
}
.bf-picker-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    width: 100%;
    min-height: 52px;
    padding: 7px 12px;
    border: 0;
    border-radius: var(--bf-radius-sm);
    background: transparent;
    color: var(--bf-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.bf-picker-option:hover,
.bf-picker-option.is-active {
    background: var(--bf-primary-soft);
}
.bf-picker-option.is-active {
    box-shadow: inset 3px 0 0 var(--bf-primary);
}
.bf-picker-name {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.bf-picker-mobile {
    color: var(--bf-text-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}
.bf-picker-note {
    padding: 10px 12px 6px;
    color: var(--bf-text-muted);
    font-size: 13px;
}
.bf-picker-add {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 44px;
    margin-top: 4px;
    border-top: 1px solid var(--bf-border);
    border-radius: 0 0 var(--bf-radius-sm) var(--bf-radius-sm);
    color: var(--bf-primary-hover);
    font-weight: 600;
}
.bf-picker-add .bf-icon {
    flex: none;
    width: 18px;
    height: 18px;
}
.bf-picker-add span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.bf-picker-quick {
    z-index: 21;
    width: max(100%, 26rem);
    border-top: 3px solid var(--bf-primary);
}
.bf-quick-add {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 16px;
}
.bf-quick-title {
    margin: 0;
    font-weight: 700;
}
.bf-quick-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 12px;
}
.bf-quick-fields .bf-field {
    margin: 0;
}
.bf-quick-add .bf-input {
    min-height: 44px;
}
.bf-quick-taken,
.bf-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bf-quick-actions {
    justify-content: flex-end;
}
.bf-quick-taken .bf-btn,
.bf-quick-actions .bf-btn {
    min-height: 44px;
}
.bf-quick-taken .bf-btn {
    max-width: 100%;
    white-space: normal;
}
