/* Design tokens. Values follow the ParcelQ palette so both Mint products read as one family. */
:root {
    color-scheme: light;

    /* Text */
    --bt-ink: #15201F;
    --bt-ink-2: #4B5856;
    --bt-ink-3: #636F6D;

    /* Surfaces and lines */
    --bt-bg: #F3F5F8;
    --bt-surface: #FFFFFF;
    --bt-surface-2: #EEF2F5;
    --bt-border: rgba(16, 40, 38, 0.09);
    --bt-border-strong: rgba(16, 40, 38, 0.18);
    --bt-shadow-ink: #102826;

    /* Accent: the only brand colour. Ink is for accent text, fill is for filled controls under white text;
       they match in the light theme and split in the dark one */
    --bt-primary: #00938C;
    --bt-primary-ink: #00706A;
    --bt-primary-ink-hover: #005E59;
    --bt-primary-fill: #00706A;
    --bt-primary-fill-hover: #005E59;
    --bt-primary-fill-active: #00524E;
    --bt-primary-tint: color-mix(in srgb, var(--bt-primary) 10%, var(--bt-surface));
    --bt-on-accent: #FFFFFF;
    --bt-focus-ring: #00706A;

    /* Status */
    --bt-success: #2E8A4E;
    --bt-success-ink: #277A44;
    --bt-success-tint: color-mix(in srgb, var(--bt-success) 11%, var(--bt-surface));
    --bt-warning: #B26100;
    --bt-warning-ink: #B26100;
    --bt-warning-tint: color-mix(in srgb, var(--bt-warning) 11%, var(--bt-surface));
    --bt-danger: #C53B3B;
    --bt-danger-ink: #C53B3B;
    --bt-danger-solid: #BB1616;
    --bt-danger-solid-hover: #9E1313;
    --bt-danger-tint: color-mix(in srgb, var(--bt-danger) 10%, var(--bt-surface));

    /* Type */
    --bt-font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bt-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    /* Shape */
    --bt-radius-chip: 8px;
    --bt-radius-control: 12px;
    --bt-radius-card: 14px;
    --bt-shadow-card: 0 1px 2px color-mix(in srgb, var(--bt-shadow-ink) 5%, transparent),
                      0 12px 32px -12px color-mix(in srgb, var(--bt-shadow-ink) 14%, transparent);

    /* Phone menu toggle: NavMenu draws it, MainLayout places the account actions just left of it */
    --bt-nav-toggler-width: 3.5rem;
    --bt-nav-toggler-inset: 1rem;

    /* Motion: hover and colour changes use the short pair; blocks entering the page use the long ease-out,
       and small pop-ins (markers, menus) the spring that overshoots slightly */
    --bt-ease: cubic-bezier(0, 0, 0.2, 1);
    --bt-duration: 0.2s;
    --bt-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --bt-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --bt-duration-enter: 0.6s;
    --bt-stagger: 70ms;
    --bt-reveal-shift: 12px;

    /* Bootstrap 5.3 hooks, so stock components pick up the tokens */
    --bs-body-font-family: var(--bt-font-sans);
    --bs-body-font-size: 0.9375rem;
    --bs-body-color: var(--bt-ink);
    --bs-body-bg: var(--bt-bg);
    --bs-emphasis-color: var(--bt-ink);
    --bs-heading-color: var(--bt-ink);
    --bs-secondary-color: var(--bt-ink-3);
    --bs-secondary-bg: var(--bt-surface-2);
    --bs-tertiary-bg: var(--bt-surface-2);
    --bs-font-monospace: var(--bt-font-mono);
    --bs-border-color: var(--bt-border);
    --bs-border-color-translucent: var(--bt-border);
    --bs-border-radius: var(--bt-radius-control);
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: var(--bt-radius-card);
    --bs-link-color: var(--bt-primary-ink);
    --bs-link-color-rgb: 0, 112, 106;
    --bs-link-hover-color: var(--bt-primary-ink-hover);
    --bs-link-hover-color-rgb: 0, 94, 89;
    --bs-code-color: var(--bt-ink-2);

    --bs-primary: #00706A;
    --bs-primary-rgb: 0, 112, 106;
    --bs-secondary-rgb: 99, 111, 109;
    --bs-success-rgb: 46, 138, 78;
    --bs-info-rgb: 0, 112, 106;
    --bs-warning-rgb: 178, 97, 0;
    --bs-danger-rgb: 197, 59, 59;

    --bs-primary-bg-subtle: var(--bt-primary-tint);
    --bs-primary-border-subtle: color-mix(in srgb, var(--bt-primary) 24%, var(--bt-surface));
    --bs-primary-text-emphasis: var(--bt-primary-ink);
    --bs-info-bg-subtle: var(--bt-primary-tint);
    --bs-info-border-subtle: color-mix(in srgb, var(--bt-primary) 24%, var(--bt-surface));
    --bs-info-text-emphasis: var(--bt-primary-ink);
    --bs-success-bg-subtle: var(--bt-success-tint);
    --bs-success-border-subtle: color-mix(in srgb, var(--bt-success) 26%, var(--bt-surface));
    --bs-success-text-emphasis: var(--bt-success-ink);
    --bs-warning-bg-subtle: var(--bt-warning-tint);
    --bs-warning-border-subtle: color-mix(in srgb, var(--bt-warning) 26%, var(--bt-surface));
    --bs-warning-text-emphasis: var(--bt-warning-ink);
    --bs-danger-bg-subtle: var(--bt-danger-tint);
    --bs-danger-border-subtle: color-mix(in srgb, var(--bt-danger) 24%, var(--bt-surface));
    --bs-danger-text-emphasis: var(--bt-danger-ink);

    /* Breakpoints */
    --breakpoint-mobile: 480px;
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 1024px;
}

/* Dark theme, from ParcelQ's dark palette. Text uses light inks of the accent and states;
   filled controls keep deep shades so white labels stay readable. Tints and Bootstrap hooks that
   reference these tokens flip on their own, only the literal rgb triplets are repeated here */
:root[data-theme="dark"] {
    color-scheme: dark;

    /* Cool graphite, the same grey family as the light theme: the teal stays on accents only */
    --bt-ink: #E6E9EE;
    --bt-ink-2: #B4BAC4;
    --bt-ink-3: #8F96A1;

    --bt-bg: #0E1116;
    --bt-surface: #161A21;
    --bt-surface-2: #1E232B;
    --bt-border: rgba(220, 228, 240, 0.1);
    --bt-border-strong: rgba(220, 228, 240, 0.18);
    --bt-shadow-ink: #05070A;

    --bt-primary: #2FA39A;
    --bt-primary-ink: #6FD0C8;
    --bt-primary-ink-hover: #8ADBD4;
    --bt-primary-fill: #186B66;
    --bt-primary-fill-hover: #1D7C76;
    --bt-primary-fill-active: #145B57;
    --bt-primary-tint: color-mix(in srgb, var(--bt-primary) 16%, var(--bt-surface));
    --bt-focus-ring: #6FD0C8;

    --bt-success: #2F8F58;
    --bt-success-ink: #6BD394;
    --bt-success-tint: color-mix(in srgb, var(--bt-success) 18%, var(--bt-surface));
    --bt-warning: #C27A1E;
    --bt-warning-ink: #E5A350;
    --bt-warning-tint: color-mix(in srgb, var(--bt-warning) 18%, var(--bt-surface));
    --bt-danger: #B8474A;
    --bt-danger-ink: #F28B8B;
    --bt-danger-solid: #A33B3B;
    --bt-danger-solid-hover: #8E3232;
    --bt-danger-tint: color-mix(in srgb, var(--bt-danger) 18%, var(--bt-surface));

    /* Shadows barely read on dark surfaces, so cards get a faint light edge instead */
    --bt-shadow-card: 0 0 0 1px rgba(220, 228, 240, 0.07),
                      0 12px 32px -12px rgba(0, 0, 0, 0.6);

    --bs-link-color-rgb: 111, 208, 200;
    --bs-link-hover-color-rgb: 138, 219, 212;
    --bs-primary: #6FD0C8;
    --bs-primary-rgb: 111, 208, 200;
    --bs-secondary-rgb: 143, 150, 161;
    --bs-success-rgb: 107, 211, 148;
    --bs-info-rgb: 111, 208, 200;
    --bs-warning-rgb: 229, 163, 80;
    --bs-danger-rgb: 242, 139, 139;
}

/* Set for a moment by js/theme.js when the user switches themes, so colours cross-fade instead of jumping */
:root.theme-switching,
:root.theme-switching *,
:root.theme-switching *::before,
:root.theme-switching *::after {
    transition: background-color 0.3s var(--bt-ease), border-color 0.3s var(--bt-ease),
                color 0.3s var(--bt-ease), fill 0.3s var(--bt-ease) !important;
}

@font-face {
    font-family: "Manrope";
    src: url("fonts/Manrope-Regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("fonts/Manrope-Medium.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("fonts/Manrope-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("fonts/Manrope-Bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Manrope";
    src: url("fonts/Manrope-ExtraBold.woff2") format("woff2");
    font-weight: 800;
    font-display: swap;
}

html, body {
    font-family: var(--bt-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.7rem);
}

h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.015em;
}

h1:focus {
    outline: none;
}

a {
    transition: color var(--bt-duration) var(--bt-ease);
}

.content {
    padding-top: 1.1rem;
}

/* One focus ring for every interactive element */
:focus-visible {
    outline: 2px solid var(--bt-focus-ring);
    outline-offset: 2px;
}

.btn:focus-visible,
.btn-close:focus-visible,
.form-check-input:focus-visible {
    box-shadow: none;
    outline: 2px solid var(--bt-focus-ring);
    outline-offset: 2px;
}

/* ===== Buttons: one filled accent per view, neutral secondary actions, red only for destructive ===== */
.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: var(--bt-radius-control);
    --bs-btn-padding-x: 1rem;
    transition: background-color var(--bt-duration) var(--bt-ease),
                border-color var(--bt-duration) var(--bt-ease),
                color var(--bt-duration) var(--bt-ease),
                transform var(--bt-duration) var(--bt-ease);
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    --bs-btn-padding-x: 0.75rem;
    --bs-btn-border-radius: 10px;
}

.btn-primary {
    --bs-btn-color: var(--bt-on-accent);
    --bs-btn-bg: var(--bt-primary-fill);
    --bs-btn-border-color: var(--bt-primary-fill);
    --bs-btn-hover-color: var(--bt-on-accent);
    --bs-btn-hover-bg: var(--bt-primary-fill-hover);
    --bs-btn-hover-border-color: var(--bt-primary-fill-hover);
    --bs-btn-active-color: var(--bt-on-accent);
    --bs-btn-active-bg: var(--bt-primary-fill-active);
    --bs-btn-active-border-color: var(--bt-primary-fill-active);
    --bs-btn-disabled-color: var(--bt-on-accent);
    --bs-btn-disabled-bg: var(--bt-primary-fill);
    --bs-btn-disabled-border-color: var(--bt-primary-fill);
}

/* Quiet icon or text action: no frame until hovered */
.btn-ghost {
    --bs-btn-color: var(--bt-ink-2);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--bt-ink);
    --bs-btn-hover-bg: var(--bt-surface-2);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--bt-ink);
    --bs-btn-active-bg: var(--bt-surface-2);
    --bs-btn-active-border-color: transparent;
}

.btn-secondary,
.btn-outline-secondary {
    --bs-btn-color: var(--bt-ink-2);
    --bs-btn-bg: var(--bt-surface);
    --bs-btn-border-color: var(--bt-border-strong);
    --bs-btn-hover-color: var(--bt-ink);
    --bs-btn-hover-bg: var(--bt-surface-2);
    --bs-btn-hover-border-color: var(--bt-border-strong);
    --bs-btn-active-color: var(--bt-ink);
    --bs-btn-active-bg: var(--bt-surface-2);
    --bs-btn-active-border-color: var(--bt-border-strong);
    --bs-btn-disabled-color: var(--bt-ink-3);
    --bs-btn-disabled-bg: var(--bt-surface);
    --bs-btn-disabled-border-color: var(--bt-border);
}

.btn-danger {
    --bs-btn-color: var(--bt-on-accent);
    --bs-btn-bg: var(--bt-danger-solid);
    --bs-btn-border-color: var(--bt-danger-solid);
    --bs-btn-hover-color: var(--bt-on-accent);
    --bs-btn-hover-bg: var(--bt-danger-solid-hover);
    --bs-btn-hover-border-color: var(--bt-danger-solid-hover);
    --bs-btn-active-color: var(--bt-on-accent);
    --bs-btn-active-bg: var(--bt-danger-solid-hover);
    --bs-btn-active-border-color: var(--bt-danger-solid-hover);
    --bs-btn-disabled-color: var(--bt-on-accent);
    --bs-btn-disabled-bg: var(--bt-danger-solid);
    --bs-btn-disabled-border-color: var(--bt-danger-solid);
}

.btn-outline-danger {
    --bs-btn-color: var(--bt-danger-ink);
    --bs-btn-bg: var(--bt-surface);
    --bs-btn-border-color: color-mix(in srgb, var(--bt-danger) 40%, var(--bt-surface));
    --bs-btn-hover-color: var(--bt-danger-ink);
    --bs-btn-hover-bg: var(--bt-danger-tint);
    --bs-btn-hover-border-color: var(--bt-danger);
    --bs-btn-active-color: var(--bt-danger-ink);
    --bs-btn-active-bg: var(--bt-danger-tint);
    --bs-btn-active-border-color: var(--bt-danger);
}

/* ===== Badges and status chips: tints with ink text, never solid saturated fills ===== */
.badge {
    font-weight: 600;
    border-radius: var(--bt-radius-chip);
    font-variant-numeric: tabular-nums;
}

.badge.bg-primary,
.badge.bg-info {
    background-color: var(--bt-primary-tint) !important;
    color: var(--bt-primary-ink);
}

.badge.bg-secondary {
    background-color: var(--bt-surface-2) !important;
    color: var(--bt-ink-2);
}

.badge.bg-success {
    background-color: var(--bt-success-tint) !important;
    color: var(--bt-success-ink);
}

.badge.bg-warning {
    background-color: var(--bt-warning-tint) !important;
    color: var(--bt-warning-ink);
}

.badge.bg-danger {
    background-color: var(--bt-danger-tint) !important;
    color: var(--bt-danger-ink);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.6em;
    border-radius: var(--bt-radius-chip);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-chip--ok {
    background: var(--bt-success-tint);
    color: var(--bt-success-ink);
}

.status-chip--warning {
    background: var(--bt-warning-tint);
    color: var(--bt-warning-ink);
}

.status-chip--critical {
    background: var(--bt-danger-tint);
    color: var(--bt-danger-ink);
}

.status-chip--neutral {
    background: var(--bt-surface-2);
    color: var(--bt-ink-2);
}

/* ===== Empty and error states ===== */
.state-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 200px;
    padding: 2rem 1.5rem;
    border-radius: var(--bt-radius-card);
    background: var(--bt-surface);
    box-shadow: var(--bt-shadow-card);
    text-align: center;
}

.state-notice__title {
    font-size: 1rem;
    font-weight: 700;
}

.state-notice--error .state-notice__title {
    color: var(--bt-danger-ink);
}

.state-notice__hint {
    color: var(--bt-ink-3);
    font-size: 0.875rem;
    max-width: 52ch;
    text-wrap: pretty;
}

.state-notice__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* ===== Cards ===== */
.card {
    --bs-card-bg: var(--bt-surface);
    --bs-card-border-color: var(--bt-border);
    --bs-card-border-radius: var(--bt-radius-card);
    --bs-card-inner-border-radius: calc(var(--bt-radius-card) - 1px);
    --bs-card-cap-bg: transparent;
    border-color: transparent;
    box-shadow: var(--bt-shadow-card);
}

.card-header h5,
.card-header h3 {
    font-weight: 700;
}

.modal {
    --bs-modal-bg: var(--bt-surface);
    --bs-modal-border-color: var(--bt-border);
    --bs-modal-border-radius: var(--bt-radius-card);
    --bs-modal-header-border-color: var(--bt-border);
    --bs-modal-footer-border-color: var(--bt-border);
}

/* Modals are toggled by Blazor without Bootstrap's script, so the entrance is pure CSS */
.modal.show .modal-dialog {
    animation: bt-modal-in 0.32s var(--bt-ease-spring) both;
}

.modal-backdrop {
    --bs-backdrop-bg: #07100F;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.modal-backdrop.show {
    animation: bt-fade-in 0.2s var(--bt-ease) both;
}

@keyframes bt-modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
}

@keyframes bt-fade-in {
    from {
        opacity: 0;
    }
}

/* Pickers in modals: app surfaces and the accent tint instead of Bootstrap's grey rows and blue selection */
.list-group {
    --bs-list-group-bg: var(--bt-surface);
    --bs-list-group-color: var(--bt-ink);
    --bs-list-group-border-color: var(--bt-border);
    --bs-list-group-action-color: var(--bt-ink);
    --bs-list-group-action-hover-color: var(--bt-ink);
    --bs-list-group-action-hover-bg: var(--bt-surface-2);
    --bs-list-group-action-active-color: var(--bt-ink);
    --bs-list-group-action-active-bg: var(--bt-surface-2);
    --bs-list-group-active-color: var(--bt-primary-ink);
    --bs-list-group-active-bg: var(--bt-primary-tint);
    --bs-list-group-active-border-color: var(--bt-border);
}

/* ===== Tables ===== */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--bt-border);
    --bs-table-striped-bg: color-mix(in srgb, var(--bt-surface-2) 60%, transparent);
    --bs-table-hover-bg: var(--bt-surface-2);
    font-variant-numeric: tabular-nums;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--bt-ink-3);
    border-bottom: 1px solid var(--bt-border-strong);
}

td {
    align-content: center;
}

/* ===== Alerts ===== */
.alert {
    --bs-alert-border-radius: var(--bt-radius-control);
}

/* ===== Forms ===== */
.form-control,
.form-select {
    border-color: var(--bt-border-strong);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bt-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bt-primary) 18%, transparent);
}

.input-group-text {
    background-color: var(--bt-surface-2);
    border-color: var(--bt-border-strong);
    color: var(--bt-ink-2);
}

.form-label {
    font-weight: 600;
    color: var(--bt-ink-2);
}

.form-check-input:checked {
    background-color: var(--bt-primary-fill);
    border-color: var(--bt-primary-fill);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Only problems are flagged: a green outline on every filled-in field was noise */
.invalid {
    outline: 1px solid var(--bt-danger);
}

.validation-message {
    color: var(--bt-danger-ink);
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ===== Misc ===== */
.spinner-border {
    color: var(--bt-primary);
}

.breadcrumb-item a {
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--bt-ink-3);
}

code {
    background-color: var(--bt-surface-2);
    padding: 0.125rem 0.375rem;
    border-radius: 6px;
    font-size: 0.875em;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--bt-danger-solid);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--bt-on-accent);
}

.blazor-error-boundary::after {
    content: "Сталася помилка."
}

/* ===== Popover menus (theme, account) ===== */
.popover-menu {
    position: relative;
}

.popover-menu__trigger {
    --bs-btn-padding-x: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    font-size: 1.0625rem;
}

/* Invisible layer that closes the menu on an outside click */
.popover-menu__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.popover-menu__list {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 1041;
    min-width: 13rem;
    padding: 0.375rem;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-card);
    background: var(--bt-surface);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--bt-shadow-ink) 8%, transparent),
                0 18px 40px -12px color-mix(in srgb, var(--bt-shadow-ink) 28%, transparent);
    transform-origin: top right;
    animation: bt-menu-in 0.22s var(--bt-ease-spring) both;
}

.popover-menu__header {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.5rem 0.75rem 0.625rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--bt-border);
}

.popover-menu__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--bt-ink-2);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    transition: background-color var(--bt-duration) var(--bt-ease), color var(--bt-duration) var(--bt-ease);
}

.popover-menu__item:hover {
    background: var(--bt-surface-2);
    color: var(--bt-ink);
}

.popover-menu__item[aria-pressed="true"] {
    color: var(--bt-primary-ink);
}

.popover-menu__check {
    margin-left: auto;
}

/* ===== Motion ===== */

/* A page fades up when it replaces another one. Blazor inserts a new DOM subtree only when the page
   component changes, so query-string updates (filters) do not replay it */
.content > * {
    animation: bt-page-in 0.45s var(--bt-ease-out) both;
}

/* Blocks that enter in sequence: set --i on each one (0, 1, 2...) */
.reveal {
    animation: bt-rise var(--bt-duration-enter) var(--bt-ease-out) both;
    animation-delay: calc(var(--i, 0) * var(--bt-stagger));
}

/* Card or row that responds to the pointer */
.lift {
    transition: transform var(--bt-duration) var(--bt-ease), box-shadow var(--bt-duration) var(--bt-ease),
                background-color var(--bt-duration) var(--bt-ease);
}

.lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--bt-shadow-ink) 6%, transparent),
                0 18px 40px -14px color-mix(in srgb, var(--bt-shadow-ink) 24%, transparent);
}

.lift:active {
    transform: translateY(0) scale(0.99);
}

/* Placeholder shaped like the content it stands in for */
.skeleton {
    display: block;
    border-radius: var(--bt-radius-chip);
    background: linear-gradient(90deg,
                var(--bt-surface-2) 25%,
                color-mix(in srgb, var(--bt-surface-2) 40%, var(--bt-surface)) 50%,
                var(--bt-surface-2) 75%);
    background-size: 200% 100%;
    animation: bt-shimmer 1.6s linear infinite;
}

/* Status dot; the halo pulses only on live states */
/* Digits are built by btMotion.roll in js/motion.js: each window shows one glyph of a 0-9 strip */
.odometer {
    --odometer-line: 1.15em;
    display: inline-flex;
    line-height: var(--odometer-line);
    font-variant-numeric: tabular-nums;
}

/* Reserve the height of the digits before the script fills them in */
.odometer:empty::before {
    content: "\00a0";
}

.odometer__digit {
    display: inline-block;
    height: var(--odometer-line);
    overflow: hidden;
}

.odometer__strip {
    display: flex;
    flex-direction: column;
    transition: transform 0.9s var(--bt-ease-out);
}

.odometer__strip > span {
    height: var(--odometer-line);
}

.live-dot {
    position: relative;
    display: inline-block;
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--bt-success);
}

.live-dot--warning {
    background: var(--bt-warning);
}

.live-dot--danger {
    background: var(--bt-danger);
}

.live-dot--misplaced {
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--bt-danger);
}

.live-dot--neutral {
    background: var(--bt-ink-3);
}

.live-dot--pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: bt-halo 2s var(--bt-ease-out) infinite;
}

@keyframes bt-page-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@keyframes bt-rise {
    from {
        opacity: 0;
        transform: translateY(var(--bt-reveal-shift));
    }
}

@keyframes bt-pop {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
}

@keyframes bt-menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.97);
    }
}

@keyframes bt-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes bt-halo {
    from {
        transform: scale(1);
        opacity: 0.55;
    }

    to {
        transform: scale(3);
        opacity: 0;
    }
}

/* Delays are dropped too, otherwise staggered blocks would sit invisible before appearing */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Map (Leaflet) ===== */
.leaflet-container {
    font-family: var(--bt-font-sans);
    background: var(--bt-surface-2);
}

/* Muted tiles let the status colours of the markers carry the map */
.leaflet-layer {
    filter: grayscale(45%) contrast(1.02);
}

/* Same treatment as ParcelQ: invert the light tiles instead of loading a second tile set */
:root[data-theme="dark"] .leaflet-layer,
:root[data-theme="dark"] .leaflet-control-zoom-in,
:root[data-theme="dark"] .leaflet-control-zoom-out,
:root[data-theme="dark"] .leaflet-control-attribution {
    filter: invert(80%) hue-rotate(180deg) brightness(95%) contrast(90%) grayscale(100%);
}

:root[data-theme="dark"] .leaflet-container {
    background: #05070A;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--bt-surface);
    color: var(--bt-ink);
    box-shadow: var(--bt-shadow-card);
}

.leaflet-popup-content-wrapper {
    border-radius: var(--bt-radius-control);
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--bt-ink-3);
}

.leaflet-popup-content {
    margin: 0.875rem 1rem;
}

/* Status markers from bleMap.renderStatusMarkers */
.bt-marker-wrap,
.bt-cluster-wrap {
    background: none;
    border: none;
}

/* A counted circle for markers grouped by Leaflet.markercluster. The ring shows the share of each status
   (custom properties set by bleMap.createClusterIcon); the centre stays neutral */
.bt-cluster {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    width: var(--size, 36px);
    height: var(--size, 36px);
    border-radius: 50%;
    border: 2px solid var(--bt-surface);
    background: conic-gradient(
        var(--bt-success) 0 var(--online),
        var(--bt-warning) 0 var(--stale),
        var(--bt-danger) 0 var(--problem),
        var(--bt-ink-3) 0);
    color: var(--bt-ink);
    font-size: 0.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--bt-shadow-ink) 35%, transparent);
    transition: transform var(--bt-duration) var(--bt-ease-spring);
}

/* The neutral centre, drawn under the count */
.bt-cluster::before {
    content: "";
    position: absolute;
    inset: 4px;
    z-index: -1;
    border-radius: 50%;
    background: var(--bt-surface);
}

.leaflet-marker-icon:hover .bt-cluster {
    transform: scale(1.1);
}

.bt-marker {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--bt-surface);
    background: var(--bt-ink-3);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--bt-shadow-ink) 35%, transparent);
    transition: transform var(--bt-duration) var(--bt-ease-spring);
}

.leaflet-marker-icon:hover .bt-marker {
    transform: scale(1.25);
}

.bt-marker--online {
    background: var(--bt-success);
}

.bt-marker--stale {
    background: var(--bt-warning);
}

.bt-marker--lost {
    background: var(--bt-danger);
}

/* A hollow danger ring: as urgent as lost, but the asset is still being seen (just elsewhere) */
.bt-marker--misplaced {
    background: var(--bt-surface);
    border-color: var(--bt-danger);
}

/* Only live markers breathe, so the eye goes to what is happening now */
.bt-marker--online::after {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: -1;
    border-radius: 50%;
    background: var(--bt-success);
    animation: bt-halo 2.2s var(--bt-ease-out) infinite;
}

.bt-marker--enter {
    animation: bt-pop 0.5s var(--bt-ease-spring) both;
    animation-delay: calc(200ms + var(--i, 0) * 60ms);
}

.bt-popup {
    min-width: 200px;
    font-size: 0.8125rem;
}

.bt-popup__title {
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--bt-ink);
}

.bt-popup__facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0.625rem 0;
}

.bt-popup__facts dt {
    font-weight: 500;
    color: var(--bt-ink-3);
}

.bt-popup__facts dd {
    margin: 0;
    color: var(--bt-ink);
}

.bt-popup__link {
    font-weight: 700;
    text-decoration: none;
}

/* ===== Panels: titled blocks of the dashboard and detail pages ===== */
.panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    padding: 1.125rem 1.25rem;
    border-radius: var(--bt-radius-card);
    background: var(--bt-surface);
    box-shadow: var(--bt-shadow-card);
}

.panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.875rem;
}

.panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.panel__subtitle {
    margin: 0.125rem 0 0;
    font-size: 0.8125rem;
    color: var(--bt-ink-3);
}

.panel__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
}

.panel__link .bi {
    display: inline-block;
    transition: transform var(--bt-duration) var(--bt-ease);
}

.panel__link:hover .bi {
    transform: translate(2px, -2px);
}

.panel__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    min-height: 160px;
    text-align: center;
    color: var(--bt-ink-3);
    font-size: 0.875rem;
}

.panel__empty-title {
    font-weight: 700;
    color: var(--bt-ink-2);
}

.panel__empty .bi {
    font-size: 1.5rem;
    color: var(--bt-success);
}

/* ===== List pages: header, toolbar, filter chips, data table ===== */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.page-header__title {
    margin: 0;
}

.page-header__meta {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--bt-ink-3);
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    --bs-btn-padding-x: 0;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
}

.btn-icon .bi {
    display: inline-block;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.search-field {
    position: relative;
    flex: 1 1 18rem;
    max-width: 28rem;
}

.search-field > .bi-search {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    color: var(--bt-ink-3);
    transform: translateY(-50%);
    pointer-events: none;
}

.search-field .form-control {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    background-color: var(--bt-surface);
}

/* The field has its own clear button; hide the browser's one for type="search" */
.search-field input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.search-field__clear {
    position: absolute;
    top: 50%;
    right: 0.375rem;
    display: grid;
    place-items: center;
    width: 1.875rem;
    height: 1.875rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--bt-ink-3);
    transform: translateY(-50%);
}

.search-field__clear:hover {
    background: var(--bt-surface-2);
    color: var(--bt-ink);
}

/* Segmented filter with counts; aria-pressed marks the active one */
.filter-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: var(--bt-radius-control);
    background: var(--bt-surface-2);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--bt-ink-2);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color var(--bt-duration) var(--bt-ease), color var(--bt-duration) var(--bt-ease),
                box-shadow var(--bt-duration) var(--bt-ease);
}

.filter-chip:hover {
    color: var(--bt-ink);
}

.filter-chip[aria-pressed="true"] {
    background: var(--bt-surface);
    color: var(--bt-ink);
    box-shadow: 0 1px 3px color-mix(in srgb, var(--bt-shadow-ink) 12%, transparent);
}

.filter-chip:disabled {
    opacity: 0.6;
}

.filter-chip__count {
    min-width: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 6px;
    background: color-mix(in srgb, var(--bt-ink-3) 14%, transparent);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.filter-chip--critical .filter-chip__count {
    background: var(--bt-danger-tint);
    color: var(--bt-danger-ink);
}

.table-panel {
    border-radius: var(--bt-radius-card);
    background: var(--bt-surface);
    box-shadow: var(--bt-shadow-card);
    overflow-x: auto;
    /* Rows rise into place; without this the shift briefly shows a vertical scrollbar */
    overflow-y: hidden;
    transition: opacity var(--bt-duration) var(--bt-ease);
}

/* Data is being reloaded (search, refresh): keep the rows but show they are about to change */
.table-panel[aria-busy="true"] {
    opacity: 0.55;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.data-table th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bt-border-strong);
    color: var(--bt-ink-3);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bt-border);
    color: var(--bt-ink-2);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* The whole row is clickable through the stretched name link, which keeps one real link per row */
.data-table__row {
    position: relative;
    transition: background-color var(--bt-duration) var(--bt-ease);
}

.data-table__row:hover {
    background: color-mix(in srgb, var(--bt-surface-2) 70%, var(--bt-surface));
}

.data-table__link {
    color: var(--bt-ink);
    font-weight: 700;
    text-decoration: none;
}

.data-table__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.data-table__link:focus-visible {
    outline: none;
}

.data-table__link:focus-visible::after {
    outline: 2px solid var(--bt-focus-ring);
    outline-offset: -2px;
    border-radius: 4px;
}

/* Name link for rows that also hold buttons, so the row itself is not one big link */
.data-table__name {
    color: var(--bt-ink);
    font-weight: 700;
    text-decoration: none;
}

.data-table__name:hover {
    color: var(--bt-primary-ink);
}

/* A table inside a panel runs edge to edge, aligned with the panel's padding */
.panel__table {
    margin: 0 -1.25rem -1.125rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.panel__table .data-table th:first-child,
.panel__table .data-table td:first-child {
    padding-left: 1.25rem;
}

.panel__table .data-table th:last-child,
.panel__table .data-table td:last-child {
    padding-right: 1.25rem;
}

.data-table__mono {
    font-family: var(--bt-font-mono);
    font-size: 0.8125rem;
}

.data-table__muted {
    color: var(--bt-ink-3);
    white-space: nowrap;
}

.data-table__chevron {
    width: 2.5rem;
    color: var(--bt-ink-3);
    text-align: right;
}

.data-table__chevron .bi {
    display: inline-block;
    transition: transform var(--bt-duration) var(--bt-ease), color var(--bt-duration) var(--bt-ease);
}

.data-table__row:hover .data-table__chevron .bi {
    color: var(--bt-primary-ink);
    transform: translateX(3px);
}

.data-table__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.data-table .skeleton {
    height: 0.875rem;
}

@media (max-width: 767.98px) {
    .data-table .hide-sm {
        display: none;
    }
}

/* Selection column: sits above the row's stretched link, and the whole cell toggles the checkbox */
.data-table .data-table__select {
    position: relative;
    z-index: 1;
    width: 2.75rem;
    padding: 0;
}

.data-table__check {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 0.25rem 0 1rem;
    cursor: pointer;
}

.data-table__check .form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    cursor: pointer;
}

/* Bootstrap's faint default border all but disappears on the dark surface */
.data-table__check .form-check-input:not(:checked) {
    border-color: var(--bt-ink-3);
    background-color: var(--bt-surface);
}

.data-table__row--selected,
.data-table__row--selected:hover {
    background: var(--bt-primary-tint);
}

/* Actions for the picked rows: floats at the bottom of the screen so it stays in reach on a long page */
.bulk-bar {
    position: sticky;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
    padding: 0.625rem 0.75rem 0.625rem 1.25rem;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-card);
    background: var(--bt-surface);
    box-shadow: var(--bt-shadow-card), 0 12px 32px -12px color-mix(in srgb, var(--bt-shadow-ink) 35%, transparent);
    animation: bt-rise 0.3s var(--bt-ease-out) both;
}

.bulk-bar__count {
    color: var(--bt-ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bulk-bar__link {
    padding: 0;
    border: none;
    background: none;
    color: var(--bt-primary-ink);
    font-weight: 600;
}

.bulk-bar__link:hover {
    text-decoration: underline;
}

.bulk-bar__actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.bulk-result__message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    color: var(--bt-success-ink);
    font-size: 0.875rem;
    font-weight: 600;
    animation: bt-rise 0.3s var(--bt-ease-out) both;
}

.bulk-progress {
    color: var(--bt-ink-3);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

/* ===== Detail pages ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    color: var(--bt-ink-3);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.back-link .bi {
    display: inline-block;
    transition: transform var(--bt-duration) var(--bt-ease);
}

.back-link:hover {
    color: var(--bt-ink);
}

.back-link:hover .bi {
    transform: translateX(-3px);
}

.page-header__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.detail-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* "Where is it now": facts on the left, the last position on a map on the right */
.where-now {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 1.25rem;
}

.where-now__age {
    margin: 0;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.where-now__when {
    margin: 0.25rem 0 1rem;
    font-size: 0.8125rem;
    color: var(--bt-ink-3);
}

.where-now__map {
    position: relative;
    min-height: 260px;
    border-radius: var(--bt-radius-control);
    overflow: hidden;
    isolation: isolate;
}

.fact-list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.5rem 1.25rem;
    margin: 0;
    font-size: 0.875rem;
}

.fact-list dt {
    font-weight: 500;
    color: var(--bt-ink-3);
}

.fact-list dd {
    margin: 0;
    color: var(--bt-ink);
    overflow-wrap: anywhere;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    border-radius: var(--bt-radius-card);
    background: var(--bt-surface);
    box-shadow: var(--bt-shadow-card);
    overflow: hidden;
}

.stat-strip__cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    border-left: 1px solid var(--bt-border);
    margin-left: -1px;
}

.stat-strip__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bt-ink-3);
}

.stat-strip__value {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.375rem;
}

@media (max-width: 991.98px) {
    .where-now {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Battery gauge: the fill width is the charge, the colour its urgency */
.battery {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    white-space: nowrap;
}

.battery__gauge {
    position: relative;
    width: 1.5rem;
    height: 0.75rem;
    padding: 1px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    opacity: 0.85;
}

.battery__gauge::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -4px;
    width: 2px;
    height: 0.3rem;
    border-radius: 0 1px 1px 0;
    background: currentColor;
    transform: translateY(-50%);
}

.battery__level {
    display: block;
    width: var(--level);
    height: 100%;
    border-radius: 1px;
    background: currentColor;
}

.battery--ok {
    color: var(--bt-success-ink);
}

.battery--warning {
    color: var(--bt-warning-ink);
}

.battery--low {
    color: var(--bt-danger-ink);
}

.count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--bt-surface-2);
    color: var(--bt-ink-2);
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* === Responsive Display Utilities === */

/* Hide on specific breakpoints */
.hidden-mobile,
.hidden-tablet,
.hidden-desktop {
    display: inline; /* default: visible */
}

@media (max-width: 480px) {
    .hidden-mobile {
        display: none !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .hidden-tablet {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hidden-desktop {
        display: none !important;
    }
}

/* Show only on specific breakpoints */
.show-mobile-only,
.show-tablet-only,
.show-desktop-only {
    display: none !important; /* default: hidden */
}

@media (max-width: 480px) {
    .show-mobile-only {
        display: inline !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .show-tablet-only {
        display: inline !important;
    }
}

@media (min-width: 769px) {
    .show-desktop-only {
        display: inline !important;
    }
}
