/*
 * File Management System - application layer on top of the Kanakku theme (doc 01 §8.3).
 * Design tokens reuse the theme's CSS variables, so light and dark mode both work. No inline styles exist
 * anywhere (Content Security Policy: style-src 'self'); dynamic sizes are set from JavaScript through CSSOM.
 */

:root {
    --fms-radius: 0.5rem;
    --fms-radius-sm: 0.375rem;
    --fms-shadow: 0 0.5rem 1.5rem rgba(5, 19, 33, 0.08);
    --fms-shadow-lg: 0 1rem 2.5rem rgba(5, 19, 33, 0.16);
    --fms-surface: var(--white);
    --fms-surface-muted: var(--light);
    --fms-border: var(--border-color);
    --fms-text: var(--gray-900);
    --fms-text-muted: var(--gray-500);
    --fms-accent: var(--primary);
    --fms-accent-soft: var(--primary-transparent);
    --fms-focus-ring: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
    --fms-dock-width: 440px;
    --fms-transition: 150ms ease;
}

/* ---------- Base ---------- */

/* The hidden attribute always wins, also over display utilities such as .d-flex (same specificity, loaded later). */
[hidden] {
    display: none !important;
}

/* The keyboard shortcut has switched the tab to its target: nothing of the page shows while the target replaces it (core/switch-guard.js). */
html.fms-switched body {
    visibility: hidden !important;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 1100;
    padding: 0.5rem 1rem;
    border-radius: var(--fms-radius-sm);
    background: var(--fms-accent);
    color: #fff;
    transition: top var(--fms-transition);
}

.skip-link:focus {
    top: 0.75rem;
    color: #fff;
}

/* Headings and containers focused by the router after navigation: no outline unless keyboard focus. */
[tabindex="-1"]:focus:not(:focus-visible) {
    outline: none;
}

.min-w-0 {
    min-width: 0;
}

.cursor-pointer {
    cursor: pointer;
}

.text-break-all {
    word-break: break-all;
}

.fs-24 {
    font-size: 1.5rem;
}

/* Thin progress bar while the in-app router loads a page. */
html.is-navigating::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--fms-accent), transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    animation: fms-progress 1s linear infinite;
}

@keyframes fms-progress {
    from { background-position: -50% 0; }
    to { background-position: 150% 0; }
}

@media (prefers-reduced-motion: reduce) {
    html.is-navigating::before {
        animation: none;
        background: var(--fms-accent);
        opacity: 0.6;
    }
}

/* ---------- Header ---------- */

.header-search-form {
    width: min(26rem, 40vw);
}

.header-search-form .form-control {
    padding-right: 2.25rem;
}

.notification-menu {
    width: 22rem;
}

.notification-menu .notification-body {
    min-height: 0;
    max-height: 22rem;
}

.notification-item.is-unread .notification-title::after {
    content: "";
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    margin-left: 0.4rem;
    border-radius: 50%;
    background: var(--success);
    vertical-align: middle;
}

.notification-menu .notification-item {
    white-space: normal;
}

.notification-menu a.notification-item:hover,
.notification-menu a.notification-item:focus-visible {
    background-color: var(--fms-accent-soft);
}

.profile-dropdown .dropdown-menu {
    min-width: 16rem;
}

.auth-logo img {
    height: 2.25rem;
    width: auto;
}

.error-icon {
    width: 5rem;
    height: 5rem;
    font-size: 2.25rem;
}

/* ---------- Avatars ---------- */

.avatar-initials {
    font-size: 0.8rem;
    line-height: 1;
    user-select: none;
}

.avatar-lg .avatar-initials,
.avatar-xl .avatar-initials {
    font-size: 1rem;
}

.avatar-xxl {
    width: 6rem;
    height: 6rem;
}

.avatar-xxl .avatar-initials {
    font-size: 1.75rem;
}

/* ---------- Page header, cards, empty and loading states ---------- */

.page-header-title {
    font-size: 1.125rem;
    margin-bottom: 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--fms-text-muted);
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background: var(--fms-accent-soft);
    color: var(--fms-accent);
    font-size: 1.75rem;
}

.empty-state h6 {
    color: var(--heading-color);
    margin-bottom: 0;
}

.skeleton {
    display: block;
    border-radius: var(--fms-radius-sm);
    background: linear-gradient(90deg, var(--fms-surface-muted) 25%, var(--fms-border) 37%, var(--fms-surface-muted) 63%);
    background-size: 400% 100%;
    animation: fms-skeleton 1.4s ease infinite;
}

.skeleton-text {
    height: 0.75rem;
    margin: 0.4rem 0;
}

.skeleton-row {
    height: 2.75rem;
    margin-bottom: 0.5rem;
}

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

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
    }
}

.error-page .error-images img {
    max-height: 18rem;
}

/* ---------- Forms ---------- */

.form-label .required {
    color: var(--danger);
    margin-left: 0.15rem;
}

.form-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.password-rules {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--fms-text-muted);
}

.password-rules li.is-met {
    color: var(--success);
}

/* A password browsers must not save or offer (A-25): a text input whose characters stay hidden until its eye is pressed. */
input[data-masked]:not(.is-revealed) {
    -webkit-text-security: disc;
}

/* The dialog that sets a person's password (A-43): its messages sit under the field, so Bootstrap's red mark, which would be drawn on top of the eye, is left out. */
#password-modal .form-control.is-invalid {
    background-image: none;
}

/* ---------- Lists and tables ---------- */

.thead-light th {
    background: var(--fms-surface-muted);
}

.sort-header {
    display: inline-flex;
    align-items: center;
    color: inherit;
    white-space: nowrap;
}

.sort-header:hover,
.sort-header.is-active {
    color: var(--fms-accent);
}

.sort-header i {
    font-size: 0.75rem;
    opacity: 0.45;
}

.sort-header.is-active i {
    opacity: 1;
}

.action-item .dropdown-item {
    cursor: pointer;
}

.access-location {
    max-width: 24rem;
}

.access-item {
    max-width: 22rem;
}

/* The address employees register a computer at (Settings > Device Lock, A-41): wide enough to read all of it. */
.register-address {
    width: min(100%, 30rem);
}

/* The QR code of the authenticator setup (A-42): drawn by js/auth.js as a small image; scaled up without blurring its squares. */
.qr-image {
    image-rendering: pixelated;
    background: #fff;
}

/* A Select2 list that opens on the page or inside a dialog hangs from a zero-width anchor: left to the full width of the
   window, its container made the page or the dialog scroll sideways (the list itself is as wide as its field). */
body > .select2-container,
.modal > .select2-container {
    width: 0 !important;
}

/* ---------- Drive ---------- */

.drive-breadcrumb {
    max-width: min(60vw, 48rem);
    overflow: hidden;
}

.drive-breadcrumb .breadcrumb-item {
    min-width: 0;
}

.drive-filter-input {
    min-width: 14rem;
    max-width: 28rem;
}

.drive-type-select {
    width: auto;
    min-width: 9rem;
}

/* The theme stretches every Select2 control to its column; in the toolbar it sizes to its content. */
.drive-toolbar .select2-container {
    width: auto !important;
    min-width: 10rem;
}

/* ---------- Settings: file types and keyboard shortcut ---------- */

.file-type-icon {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.mime-type {
    max-width: 18rem;
}

.shortcut-recorder {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.625rem 0.875rem;
    border: 1px dashed var(--fms-border);
    border-radius: var(--fms-radius);
    background: var(--fms-surface);
    cursor: pointer;
}

.shortcut-recorder:focus-visible,
.shortcut-recorder.is-recording {
    border-style: solid;
    border-color: var(--fms-accent);
    outline: none;
    box-shadow: 0 0 0 0.2rem var(--fms-accent-soft);
}

.shortcut-recorder:has(+ input.is-invalid) {
    border-color: var(--bs-form-invalid-border-color);
}

.shortcut-keys {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.shortcut-key {
    min-width: 2rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--fms-border);
    border-bottom-width: 3px;
    border-radius: 0.375rem;
    background: var(--fms-surface);
    color: var(--fms-text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

.shortcut-plus {
    color: var(--fms-text-muted);
    font-weight: 600;
}

.shortcut-recorder-hint {
    color: var(--fms-text-muted);
}

/* ---------- Kanakku Select2 controls (theme-controls.js) ---------- */

/* Validation state of the control that stands in for an invalid select. */
select.is-invalid + .select2-container .select2-selection {
    border-color: var(--bs-form-invalid-border-color);
}

.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
    border-color: var(--fms-accent);
}

.select2-container .select2-selection:focus-visible {
    outline: 2px solid var(--fms-accent);
    outline-offset: 1px;
}

/* Lists opened inside dialogs stay above the dialog. */
.modal .select2-dropdown,
.offcanvas .select2-dropdown {
    z-index: 1060;
}

/* Both views are rendered; the preference shows one of them. */
.drive-content[data-view="grid"] .drive-view-list,
.drive-content[data-view="list"] .drive-view-grid {
    display: none;
}

.drive-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fms-text-muted);
    margin-bottom: 0.75rem;
}

.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
}

.drive-grid .folder-wrap {
    margin-bottom: 0;
    padding: 0.875rem 1rem;
}

.drive-item {
    transition: box-shadow var(--fms-transition), border-color var(--fms-transition), background-color var(--fms-transition);
}

.folder-wrap.drive-item:hover,
.folder-wrap.drive-item:focus-within {
    border-color: rgba(var(--primary-rgb), 0.45);
}

.drive-item:focus-visible {
    outline: 2px solid var(--fms-accent);
    outline-offset: 2px;
}

.drive-item-link {
    color: inherit;
}

.drive-table tbody tr.drive-item:hover,
.drive-table tbody tr.drive-item:focus-within {
    background: var(--fms-accent-soft);
}

.drive-name-cell {
    max-width: 26rem;
}

/* overflow:hidden inline-blocks sit on their bottom edge; align them with the rest of the row. */
.drive-location-cell {
    max-width: 14rem;
    vertical-align: middle;
}

.drive-owner-cell {
    max-width: 12rem;
    vertical-align: middle;
}

.drive-heading-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.drive-context-menu {
    position: fixed;
    z-index: 1080;
    min-width: 13rem;
}

.drive-drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.1);
    border: 3px dashed var(--fms-accent);
    pointer-events: none;
}

.drive-drop-message {
    padding: 2rem 3rem;
    border-radius: var(--fms-radius);
    background: var(--fms-surface);
    box-shadow: var(--fms-shadow-lg);
    text-align: center;
}

.drive-drop-message i {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    color: var(--fms-accent);
}

.drive-details {
    --bs-offcanvas-width: 26rem;
}

.details-icon {
    width: 3.5rem;
}

.file-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.875rem;
}

.file-info dt {
    font-weight: 500;
    color: var(--fms-text-muted);
}

.file-info dd {
    margin: 0;
    min-width: 0;
    color: var(--heading-color);
    overflow-wrap: anywhere;
}

.file-preview-none {
    padding: 4rem 1rem;
}

.file-preview-icon {
    width: 4rem;
}

.drive-preview-body {
    min-height: 50vh;
}

/* ---------- File viewer (A-28): PDFs page by page, images and spreadsheets, in the page; nothing to save or print ---------- */
.file-viewer {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 12.5rem);
    min-height: 26rem;
    overflow: hidden;
    border-radius: inherit;
    background: var(--fms-surface-muted);
}

.drive-preview-body.file-viewer {
    height: 80vh;
    min-height: 0;
}

.viewer-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--fms-border);
    background: var(--fms-surface);
}

.viewer-button {
    width: 2rem;
    height: 2rem;
    padding: 0;
}

.viewer-zoom {
    min-width: 3.25rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.viewer-page-number {
    font-variant-numeric: tabular-nums;
}

.viewer-scroll {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.viewer-scroll:focus-visible {
    outline: none;
    box-shadow: inset var(--fms-focus-ring);
}

.viewer-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: max-content;
    min-width: 100%;
    padding: 1rem;
}

.viewer-page {
    position: relative;
    flex-shrink: 0;
    background: #fff;
    box-shadow: var(--fms-shadow);
}

.viewer-page canvas {
    display: block;
}

.viewer-page-error {
    padding: 1rem;
    color: #6c757d;
}

.viewer-image-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-width: 100%;
    min-height: 100%;
    padding: 1rem;
}

.viewer-image-frame.is-fit {
    width: 100%;
    height: 100%;
}

.viewer-image {
    display: block;
    max-width: none;
    background: repeating-conic-gradient(var(--fms-border) 0 25%, transparent 0 50%) 0 0 / 1rem 1rem;
    box-shadow: var(--fms-shadow);
}

.viewer-image-frame.is-fit .viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.viewer-sheet-scroll {
    background: var(--fms-surface);
}

.viewer-sheet {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    color: var(--fms-text);
    background: var(--fms-surface);
}

.viewer-sheet th,
.viewer-sheet td {
    max-width: 30rem;
    padding: 0.25rem 0.5rem;
    border-right: 1px solid var(--fms-border);
    border-bottom: 1px solid var(--fms-border);
    white-space: pre-wrap;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.viewer-sheet td.is-number {
    text-align: right;
    white-space: nowrap;
}

.viewer-sheet thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 500;
    text-align: center;
    color: var(--fms-text-muted);
    background: var(--fms-surface-muted);
}

.viewer-sheet tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 3rem;
    font-weight: 400;
    text-align: right;
    color: var(--fms-text-muted);
    background: var(--fms-surface-muted);
}

.viewer-sheet thead th.viewer-sheet-corner {
    left: 0;
    z-index: 3;
}

.viewer-sheet-row-head {
    width: 3.5rem;
}

.viewer-sheet-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0 0.75rem;
    border-top: 1px solid var(--fms-border);
    background: var(--fms-surface-muted);
}

.viewer-sheet-tab {
    padding: 0.375rem 0.875rem;
    border: 1px solid transparent;
    border-top: 0;
    border-radius: 0 0 var(--fms-radius-sm) var(--fms-radius-sm);
    font-size: 0.8125rem;
    white-space: nowrap;
    color: var(--fms-text-muted);
    background: transparent;
}

.viewer-sheet-tab:hover {
    color: var(--heading-color);
}

.viewer-sheet-tab.active {
    font-weight: 500;
    color: var(--fms-accent);
    border-color: var(--fms-border);
    background: var(--fms-surface);
}

.viewer-notice {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--fms-text-muted);
    border-top: 1px solid var(--fms-border);
    background: var(--fms-surface);
}

.viewer-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    padding: 3rem 1rem;
    max-width: 32rem;
    text-align: center;
}

.move-tree {
    max-height: 50vh;
    overflow-y: auto;
}

.move-toggle {
    width: 1.5rem;
    flex-shrink: 0;
}

.move-node {
    --bs-btn-hover-bg: var(--fms-surface-muted);
    font-weight: 500;
}

.move-node.is-selected,
.move-node.is-selected:hover {
    --bs-btn-bg: var(--fms-accent-soft);
    --bs-btn-hover-bg: var(--fms-accent-soft);
    --bs-btn-color: var(--fms-accent);
    --bs-btn-hover-color: var(--fms-accent);
    background-color: var(--fms-accent-soft);
    color: var(--fms-accent);
    box-shadow: inset 2px 0 0 var(--fms-accent);
}

.breadcrumb-text {
    max-width: 14rem;
    vertical-align: bottom;
}

.move-selection {
    max-width: 50%;
}

.access-source {
    max-width: 12rem;
}

/* ---------- Toasts and dialogs ---------- */

/* Bottom centre: clear of the page actions (top right) and the upload dock (bottom right). */
#toast-container {
    z-index: 1090;
    width: min(28rem, calc(100vw - 2rem));
}

#toast-container .toast {
    width: 100%;
}

.toast .toast-body {
    font-size: 0.875rem;
}

/* ---------- Upload dock (doc 04 §9) ---------- */

.upload-dock {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1045;
    width: var(--fms-dock-width);
    max-width: calc(100vw - 2rem);
    margin: 0;
    border: 1px solid var(--fms-border);
    border-radius: var(--fms-radius);
    background: var(--fms-surface);
    box-shadow: var(--fms-shadow-lg);
    overflow: hidden;
}

.upload-dock-body {
    max-height: min(50vh, 26rem);
    overflow-y: auto;
}

.upload-dock .progress-xs {
    height: 0.35rem;
}

.upload-dock-header {
    border-bottom: 1px solid var(--fms-border);
}

.upload-dock-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.upload-dock-icon {
    display: inline-flex;
    flex-shrink: 0;
    font-size: 1.25rem;
    color: var(--fms-accent);
}

.upload-dock-icon.is-completed { color: var(--bs-success); }
.upload-dock-icon.is-failed,
.upload-dock-icon.is-stopped { color: var(--bs-danger); }
.upload-dock-icon.is-completed-with-errors,
.upload-dock-icon.is-not-uploaded,
.upload-dock-icon.is-paused,
.upload-dock-icon.is-retrying,
.upload-dock-icon.is-offline { color: var(--bs-warning); }

.upload-dock-progress {
    height: 0.35rem;
}

.upload-icon-button {
    width: 1.875rem;
    height: 1.875rem;
    padding: 0;
}

.upload-stats {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.125rem 0.75rem;
    font-size: 0.75rem;
}

.upload-stats dt {
    font-weight: 500;
    color: var(--fms-text-muted);
}

.upload-stats dd {
    margin: 0;
}

.upload-batch,
.upload-interrupted {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--fms-border);
}

.upload-interrupted {
    display: block;
    padding: 0.75rem;
    border: 1px solid var(--fms-border);
    border-radius: var(--fms-radius-sm);
    background: var(--fms-surface-muted);
}

/* Virtualized list: rows are absolutely positioned inside a spacer as tall as all rows (dock.js ROW_HEIGHT). */
.upload-list {
    position: relative;
    height: min(40vh, 18rem);
    overflow-y: auto;
    border-top: 1px solid var(--fms-border);
}

.upload-list-spacer {
    width: 1px;
}

.upload-row {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    height: 58px;
    padding: 0 1rem;
    border-bottom: 1px solid var(--fms-border);
}

.upload-row-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
}

.upload-row-main {
    flex: 1 1 auto;
}

.upload-row-name {
    font-size: 0.8125rem;
    font-weight: 500;
}

.upload-row-meta {
    font-size: 0.75rem;
}

.upload-row-bar {
    height: 0.2rem;
    margin-top: 0.25rem;
    border-radius: 1rem;
    background: var(--fms-surface-muted);
    overflow: hidden;
}

.upload-row-bar-fill {
    height: 100%;
    background: var(--fms-accent);
}

.upload-row-bar-fill.is-done { background: var(--bs-success); }
.upload-row-bar-fill.is-failed { background: var(--bs-danger); }

.upload-row-actions {
    display: flex;
    flex-shrink: 0;
    gap: 0.25rem;
}

.conflict-names {
    padding-left: 1.25rem;
}

.drive-item.is-drop-target {
    border-color: var(--fms-accent);
    box-shadow: var(--fms-focus-ring);
}

.drive-table tbody tr.drive-item.is-drop-target {
    outline: 2px solid var(--fms-accent);
    outline-offset: -2px;
    background: rgba(var(--primary-rgb), 0.06);
}

/* Moving an item by dragging it (js/pages/drive/drag-drop.js): the item, the places it can go and the ones it cannot. */
.drive-item.is-dragging {
    opacity: 0.45;
}

.drive-item.is-drop-denied,
.drive-breadcrumb a.is-drop-denied {
    cursor: not-allowed;
    opacity: 0.6;
}

.drive-page.is-moving :is([data-drop-folder], [data-drop-root]) {
    border-radius: 0.25rem;
    background: rgba(var(--primary-rgb), 0.07);
}

.drive-breadcrumb a.is-drop-target {
    border-radius: 0.25rem;
    background: rgba(var(--primary-rgb), 0.2);
}

.drive-drag-image {
    position: fixed;
    top: -100px;
    left: -100px;
    display: flex;
    align-items: center;
    max-width: 16rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--fms-accent);
    border-radius: var(--fms-radius);
    background: var(--fms-surface);
    box-shadow: var(--fms-shadow-lg);
    font-weight: 500;
    pointer-events: none;
}

.drive-drag-image span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Browser protection (A-31, js/core/protection.js): no selecting, dragging or printing; cover and watermark ---------- */
html.fms-protected body {
    -webkit-user-select: none;
    user-select: none;
}

html.fms-protected :is(input, textarea, select, [contenteditable]:not([contenteditable="false"])) {
    -webkit-user-select: text;
    user-select: text;
}

html.fms-protected :is(img, canvas, a) {
    -webkit-user-drag: none;
}

.fms-watermark {
    position: fixed;
    inset: 0;
    z-index: 2050;
    pointer-events: none;
    background-repeat: repeat;
}

.fms-shield {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--fms-surface, #fff);
}

html.fms-shielded .fms-shield {
    display: flex;
}

.fms-shield-box {
    max-width: 24rem;
    padding: 1.5rem;
    text-align: center;
}

.fms-shield-title {
    margin-bottom: 0.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--heading-color);
}

.fms-shield-text {
    margin: 0;
    color: var(--fms-text-muted);
}

@media print {
    html.fms-protected body {
        display: none !important;
    }

    html.fms-protected::after {
        content: "This page cannot be printed.";
        display: block;
        padding: 2rem;
        font: 16px sans-serif;
    }
}
