html, body {
    font-family: var(--rz-text-font-family, Roboto, sans-serif);
}

body {
    /* Matches the legacy Unfold admin's base text size (Tailwind `text-sm` applied to
       <body> only, not <html> — Unfold's own rem-based utility spacing stays keyed to the
       16px root either way). Set on body (not html) for the same reason: shrinking the root
       font-size would also shrink every rem-based Radzen component dimension (padding, gaps,
       icon sizes), not just inherited text. Radzen's own --rz-body-font-size variable only
       covers input controls, not the document base, so it doesn't get this on its own. */
    font-size: 0.875rem !important;
}

h1:focus {
    outline: none;
}

.fab-add-button.rz-button {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    padding: 0;
    border-radius: 50%;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZ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AyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.app-skeleton {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #fff;
    overflow: hidden;
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 50px;
    padding: 0 1rem;
    border-bottom: 1px solid #e6e6e6;
    flex-shrink: 0;
}

.skeleton-header-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.skeleton-header-title {
    width: 110px;
    height: 16px;
    border-radius: 4px;
}

.skeleton-header-spacer {
    flex: 1;
}

.skeleton-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.skeleton-sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    border-right: 1px solid #e6e6e6;
}

.skeleton-sidebar-item {
    width: 100%;
    height: 14px;
    border-radius: 4px;
}

.skeleton-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.skeleton-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-title {
    width: 140px;
    height: 22px;
    border-radius: 4px;
}

.skeleton-button {
    width: 110px;
    height: 34px;
    border-radius: 6px;
}

.skeleton-row {
    width: 100%;
    height: 36px;
    border-radius: 4px;
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #eaeaea 25%, #f5f5f5 37%, #eaeaea 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

@media (prefers-color-scheme: dark) {
    .app-skeleton {
        background: #121212;
    }

    .skeleton-header, .skeleton-sidebar {
        border-color: #2a2a2a;
    }

    .skeleton-shimmer {
        background: linear-gradient(90deg, #2a2a2a 25%, #333333 37%, #2a2a2a 63%);
        background-size: 400% 100%;
    }
}

@media (max-width: 768px) {
    .skeleton-sidebar {
        display: none;
    }
}

code {
    color: #c02d76;
}

.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;
}

/* Leaflet "Lat, lon or place name" search box (leafletEditor.js addCoordinateSearch) — left
   deliberately un-themed like Leaflet's other controls (zoom, layers, draw toolbar), which
   already render as plain white boxes regardless of the app's light/dark theme.

   Appended straight to .leaflet-container (position:relative, set by Leaflet itself) rather than
   through L.control()'s corner system, which only offers left/right-aligned stacks — so this is
   positioned by hand, centered along the top edge instead. z-index matches Leaflet's own
   .leaflet-control-container so it layers above the map panes the same way corner controls do. */
.leaflet-coordinate-search {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 0.25rem;
    padding: 0.35rem;
    background: #fff;
}

.leaflet-coordinate-search input {
    width: 180px;
    padding: 0.25rem 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.8rem;
    /* Plain <input>, not a Radzen component — without this it inherits Radzen's themed (grayish,
       not pure black) --rz-text-color instead of reading like ordinary map-control text. */
    color: #000;
}

.leaflet-coordinate-search button {
    padding: 0.25rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f4f4f4;
    font-size: 0.8rem;
    color: #000;
    cursor: pointer;
}

.leaflet-coordinate-search button:hover {
    background: #e6e6e6;
}

/* Fullscreen toggle button (leafletEditor.js addFullscreenControl) — a plain Leaflet toolbar
   button like the zoom/layers controls, left un-themed for the same reason as the search box
   above. */
.leaflet-control-fullscreen-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #fff;
    color: #000;
    font-size: 1rem;
    text-decoration: none;
}

.leaflet-control-fullscreen-button:hover {
    background: #f4f4f4;
}

/* Fullscreen state for a map container (toggled by the button above): covers the viewport
   instead of the page's normal layout, so a cramped fixed-height map (e.g. 500px) gets much
   more room to draw/inspect geometry without changing the page's regular layout otherwise. */
.leaflet-map-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2000;
    border-radius: 0 !important;
}