/*
 * Copyright (C) 2024 S&P Global.
 *
 * All Rights Reserved
 *
 * Notice: The information, data, processing technology, software (including source code),
 * technical and intellectual concepts and processes and all other materials provided
 * (collectively the "Property") are Copyright © 2020, S&P Global and/or its affiliates
 * (together "S&P Global") and constitute the proprietary and confidential information of
 * S&P Global. S&P Global reserves all rights in and to the Property. Any copying,
 * reproduction, distribution, transmission or disclosure of the Property, in any form, is
 * strictly prohibited without the prior written consent of S&P Global. Unless otherwise
 * agreed in writing, the Property is provided on an "as is" basis and S&P Global makes no
 * warranty, express or implied, as to its accuracy, completeness, timeliness, or to any
 * results to be obtained by recipient nor shall S&P Global in any way be liable to any
 * recipient for any inaccuracies, errors or omissions in the Property. Without limiting the
 * generality of the foregoing, S&P Global shall have no liability whatsoever to any
 * recipient of the Property, whether in contract, in tort (including negligence), under
 * warranty, under statute or otherwise, in respect of any loss or damage suffered by any
 * recipient as a result of or in connection with such Property, or any course of action
 * determined, by it or any third party, whether or not based on the Property. The S&P Global
 * logo is a registered trademark of S&P Global, and the trademarks of S&P Global used
 * herein are protected by international laws. Any other names may be trademarks of their
 * respective owners.
 */

@import "material-icons.css";
@import "fonts.css";

:root {
    /* Menu colors - using Bootstrap variables where appropriate */
    --n6-menu-color: var(--bs-body-color);
    --n6-menu-background-color: var(--bs-gray-200);
    --n6-corp-red-background: color-mix(in srgb, var(--bs-danger) 15%, transparent);

    --n6-text-inclusive: var(--bs-success);
    --n6-text-exclusive: var(--bs-danger);
    --n6-text-bg-green: #e2ffda;
    --n6-text-bg-red: #ffe8e8;
    --n6-text-bg-yellow: #fffbd8;
    --n6-editable-background: var(--bs-gray-100);

    --n6-highlight:var(--n6-text-bg-yellow);
    --n6-highlight-text: var(--bs-body-color);
    --n6-drag-bg: var(--n6-text-bg-yellow);

    /**
     * Height offset subtracted from 100svh to size the AdvancedGrid (.n6-ag-fill).
     * Override this in the consuming application's CSS to match the actual page chrome
     * (header + tab bar + any padding).  Example: --n6-viewport-offset: 8rem;
     */
    --n6-viewport-offset: 10rem;
}

[data-bs-theme=dark]:root {
    /* ====================================
     * DARK THEME OVERRIDES
     * ====================================
     * Only override application-specific variables, corporate colors come from Bootstrap
     */

    --n6-menu-color: var(--bs-body-color);
    --n6-menu-background-color: var(--bs-gray-800);
    --n6-corp-red-background: color-mix(in srgb, var(--bs-danger) 15%, transparent);
    --n6-text-inclusive: rgba(172, 255, 172, 0.75);
    --n6-text-exclusive: #fe8a8a;
    --n6-text-bg-green: rgb(19, 63, 6);
    --n6-text-bg-red: #3f0a0a;
    --n6-editable-background: var(--bs-gray-800);

    --n6-highlight: var(--bs-body-bg);
    --n6-highlight-text: #fffbd8;
    --n6-drag-bg: rgba(255, 251, 216, 0.20);
}

[data-bs-theme=high-contrast]:root {

    --n6-text-bg-green: rgb(19, 63, 6);
    --n6-text-bg-red: #3f0a0a;

    --n6-highlight: var(--bs-body-bg);
    --n6-highlight-text: #fffbd8;
    --n6-drag-bg: rgba(255, 251, 216, 0.20);
}

[data-bs-theme=reading]:root {
    /* ====================================
     * READING MODE THEME
     * ====================================
     * Warm sepia/cream tones to reduce eye strain during extended reading.
     * Inherits Bootstrap light theme base; only application-specific and
     * key Bootstrap variables are overridden here.
     */

    /* Bootstrap body variables */
    --bs-body-bg: #fdf6e3;
    --bs-body-bg-rgb: 253, 246, 227;
    --bs-body-color: #4a3728;
    --bs-body-color-rgb: 74, 55, 40;
    --bs-secondary-bg: #f0e8d5;
    --bs-tertiary-bg: #e8ddc5;

    /* N6 application variables */
    --n6-menu-color: #4a3728;
    --n6-menu-background-color: #ede0c4;
    --n6-editable-background: #f5edd8;

    --n6-text-bg-green: #d4edda;
    --n6-text-bg-red: #f8d7da;
    --n6-text-bg-yellow: #fff3cd;

    --n6-highlight: #fff3b0;
    --n6-highlight-text: #4a3728;
    --n6-drag-bg: #fff3b0;
}

/* ====================================
 * COMPONENT STYLES
 * ====================================
 * Using Bootstrap corporate colors instead of custom definitions
 */

/* Header */
#dm-header {
    border-top: solid 1px var(--bs-danger);
}

/* Search */
#search, .n6-filter {
    padding-left: 30px;
}

#search {
    width:250px;
    font-style:italic;
}

#search > span {
    border-bottom: solid 1px var(--bs-danger);
}

.n6-nav-list li[tabindex]:focus-visible {
    outline:solid 2px var(--bs-focus-ring-color)
}

.n6-input-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.n6-input-height input {
    min-height: 38px;
}

.n6-input-with-icon {
    position: relative;
    display: inline;
    align-items: center;
}

.n6-input-with-icon input {
    padding-left: 34px;
}

.n6-input-with-icon .material-icons {
    position: absolute;
    left: 12px;
    top:2px;
    pointer-events: none;
}

.n6-width-auto {
    width: auto !important;
}

.envSwitcher {
    font-weight: bold;
    min-width: 60px;
}

.envSwitcher select {
    border-width: 2px;
    padding: 0 0 0 2px;
    border-color: var(--env);
    font-size: 80%;
    font-weight: bold;
    height: 25px;
}

h2 {
    font-size: 18pt;
    font-weight: bold;
}

[data-bs-theme="dark"] h2,[data-bs-theme="high-contrast"] h2 {
    color: var(--bs-body-color);
}

.dm-corp-logo {
    background-image: url('../images/sp-logo-header.svg');
    width: 48px;
    height: 24px;
    display: inline-block;
    background-repeat: no-repeat;
    border-right: 1px solid var(--bs-border-color);
    padding-right: 60px;
}

[data-bs-theme=dark] .dm-corp-logo {
    background-image: url('../images/sp-logo-header-dark.svg');
}

/* BreadCrumbs */
.breadcrumb {
    --bs-breadcrumb-margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--n6-menu-color);
    text-decoration-line: none;
}

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

.n6-menu-item a, .n6-menu-item-active a {
    color: var(--n6-menu-color);
}

.n6-menu-item {
    margin-left: 4px
}

.n6-menu-item:hover {
    background-color: var(--n6-menu-background-color);
}

.n6-menu-item-active {
    background-color: var(--n6-menu-background-color);
    border-left: solid 4px var(--bs-danger); /* Using Bootstrap danger (corporate brand red) */
}

.n6-collapse-button {
    height: 40px;
    width: 40px;
}

.n6-text-with-help {
    color: var(--n6-menu-color);
    cursor: help;
    text-decoration: none;
}

.n6-text-with-help:hover {
    text-decoration: underline;
}

.n6-help {
    cursor: help;
    padding-top: 2px;
}

.autocomplete-suggestion b {
    font-weight: normal;
    background-color: var(--n6-drag-bg);
}

/* Grid */
.n6-grid thead {
    border-top: solid 1px var(--bs-border-color);
    border-bottom: solid 2px var(--bs-border-color);
}

/* AdvancedGrid – flex column layout so navbar + pagination are always visible */
.n6-advanced-grid {
    display: flex;
    flex-direction: column;
}

/* Navbar and pagination strip must not shrink — the table area takes all remaining space */
.n6-advanced-grid > nav,
.n6-advanced-grid > .n6-ag-chips-bar,
.n6-advanced-grid > .n6-ag-table-wrap ~ div {
    flex-shrink: 0;
}

/* Compact navbar — reduce Bootstrap's default .navbar padding and reset the h2 caption
   so the top bar and paginator strip have the same visual height (~2.5rem). */
.n6-advanced-grid > nav {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.n6-advanced-grid > nav h2 {
    font-weight: 600;
    margin-bottom: 0;     /* remove Bootstrap's h2 bottom margin so it doesn't push buttons down */
    line-height: 1.2;
}

/* Wrapper that owns the flex sizing and provides the positioning context for the
   loading overlay. The overlay must live here (outside the scrollable child) so
   that position:absolute doesn't scroll away with table content. */
.n6-ag-table-wrap {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* Scrollable table area — fills the wrapper completely */
.n6-ag-table-container {
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
}

/* Loading overlay — semi-transparent cover shown during data fetch.
   Positioned relative to n6-ag-table-wrap (its parent), which is NOT scrollable,
   so the overlay always covers the full visible table area regardless of scroll position. */
.n6-ag-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--bs-body-bg-rgb, 255,255,255), 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

/* Full-screen mode.
   z-index 1060: above Bootstrap's modal-backdrop (1040) and modal (1055) so that
   modals opened inside the full-screen grid are not obscured by the backdrop. */
.n6-ag-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1060;
    height: 100dvh !important;
    background: var(--bs-body-bg);
    padding: 0.75rem;
    border-radius: 0;
    overflow: hidden;
}

/* Modals that live inside the full-screen grid must sit above the grid itself */
.n6-ag-fullscreen .modal {
    z-index: 1070;
}

/* Active filter chips bar */
.n6-ag-chips-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.25rem 0 0.4rem;
}

/* Filter chip — ensure text and close button are perfectly centred */
.n6-ag-chip {
    line-height: 1;
    padding-top: 0.4em;
    padding-bottom: 0.4em;
    vertical-align: middle;
}

.n6-ag-chip > span {
    vertical-align: middle;
    line-height: 1;
}

/* Empty-state row */
.n6-ag-empty-state {
    color: var(--bs-secondary-color);
}

/* Copy-cell feedback toast */
.n6-ag-copy-toast {
    position: absolute;
    top: 2px;
    right: 4px;
    background: var(--bs-primary);
    color: #fff;
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}
.n6-ag-copy-toast-fade {
    opacity: 0;
}

/* View-popup text highlight */
mark.n6-ag-highlight {
    background-color: #ff0;
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Sticky column-header row inside the scrollable container.
   z-index 100: must be above any positioned content rendered by cellHtmlRenderer
   (Bootstrap badges, modals, icons inside <td> cells create new stacking contexts). */
.n6-ag-table-container thead th {
    position: sticky;
    top: 0;
    z-index: 100;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    /* Use the card background when available so the header matches its container */
    background-color: var(--bs-card-bg, var(--bs-body-bg));
    /* border-collapse removes real borders from sticky elements — simulate with inset box-shadow */
    box-shadow: inset 0 1px 0 var(--bs-border-color), inset 0 -2px 0 var(--bs-border-color);
}

/* Uniform height for all pagination items (icons + page counter) */
.n6-advanced-grid .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
}

/* Page counter between nav buttons — override Bootstrap's disabled muting */
.n6-advanced-grid .page-item.disabled .page-link.text-primary {
    color: var(--bs-primary) !important;
    opacity: 1;
    background-color: var(--bs-body-bg);
}

/* Column header icon size */
.n6-advanced-grid .n6-ag-col-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ── CSP-safe replacements for inline styles removed from advanced-grid.js ── */

/* Cell value icon (replaces style="font-size:1rem;line-height:1") */
.n6-ag-cell-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Edit / Delete action icons (replaces style="font-size:1.1rem;vertical-align:middle") */
.n6-ag-action-icon {
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Menu dropdown item icons */
.n6-ag-menu-icon {
    font-size: 1rem;
    vertical-align: middle;
}

/* Response-time timer icon in the pagination bar */
.n6-ag-response-time {
    font-size: 0.75rem;
    opacity: 0.7;
}

.n6-ag-time-icon {
    font-size: 0.9rem;
    vertical-align: middle;
    margin-right: 0.15rem;
    color: var(--bs-teal, #20c997);
}

/* Hide the Bootstrap dropdown caret on the grid Menu button */
.n6-ag-menu-btn.dropdown-toggle::after {
    display: none;
}

/* Without Bootstrap's Popper.js the [data-bs-popper] selector that normally applies
   right:0 to .dropdown-menu-end is absent.  Pin the menu to the right edge of its
   .dropdown wrapper so it never overflows the right side of the viewport. */
.n6-advanced-grid .dropdown-menu {
    right: 0;
    left: auto;
}

/* Pagination nav button icons (replaces style="font-size:1.1rem;line-height:1") */
.n6-ag-nav-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Empty-state icon (replaces style="font-size:3.5rem;opacity:0.25") */
.n6-ag-empty-icon {
    font-size: 3.5rem;
    opacity: 0.25;
}

/* Filter-chip close button size (replaces style="font-size:0.55em") */
.n6-ag-chip-close {
    font-size: 0.55em;
}

/* Inline toolbar filter inputs — constrained width so they don't stretch the toolbar */
.n6-ag-toolbar-field {
    width: 11rem;
}

/* Lookup-table free-text input — width and height aligned to btn-sm */
.n6-ag-lookup-input {    width: 16rem;
    padding-left: 1.75rem;        /* make room for the search icon */
    -webkit-appearance: none;     /* suppress Safari/Chrome native search-input chrome */
    appearance: none;
}

/* Search icon overlaid on the left of the lookup input */
.n6-ag-lookup-icon {
    position: absolute;
    left: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
    color: var(--bs-primary);
    z-index: 4;
}

/* Off-screen textarea used as clipboard fallback — never visible */
.n6-ag-clipboard-helper {
    position: fixed;
    top: -9999px;
    left: -9999px;
    opacity: 0;
}

/* Auto-height: fills the remaining viewport below the grid's top edge.
   --n6-viewport-offset should account for the page header + tab nav + any padding.
   Override this variable in the app's own CSS if the page chrome is a different height. */
.n6-ag-fill {
    height: calc(100svh - var(--n6-viewport-offset, 10rem));
}

/* Popup modal body: flex-grows to fill the modal, iframe overflows it (CSP-safe, no JS inline style) */
.n6-ag-popup-body {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: relative;
}

/* Popup iframe: fills the modal body absolutely so percentage height resolves correctly */
.n6-ag-popup-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Copy-toast: td cells that host the floating toast need position:relative */
.n6-ag-cell-relative {
    position: relative;
}

/* Form */
.n6-data-form .n6-property-table th {
    min-height: 39px;
    height: 39px;
    vertical-align: middle;
}

.n6-select-property-header {
    height: 39px;
}

.n6-property-table tr:last-child > td,
.n6-property-table tr:last-child > th {
    border-bottom: 0 !important;
}

.n6-delete-hover {
    background-color: var(--n6-text-bg-red) !important;
}

/* Table */
.n6-shrink {
    width:1px;
    white-space: nowrap;
}

/* Width utilities - could potentially be replaced with Bootstrap utilities */
.n6-w-20 {
    width:20px;
    min-width: 20px;
}

.n6-w-40 {
    width:40px;
    min-width: 40px;
}

.n6-w-60 {
    width:60px;
    min-width: 60px;
}

.n6-w-80 {
    width:80px;
    min-width: 80px;
}

.n6-w-100 {
    width:100px;
    min-width: 100px;
}

.n6-w-200 {
    width:200px;
    min-width: 200px;
}

.n6-w-300 {
    width:300px;
    min-width: 300px;
}

.n6-w-400 {
    width:400px;
    min-width: 400px;
}

.n6-w-600 {
    width:600px;
    min-width: 600px;
}

.n6-text-bg-green {
    background-color: var(--n6-text-bg-green);
}

.n6-text-bg-green-important {
    background-color: var(--n6-text-bg-green)!important;
}

.n6-text-bg-red {
    background-color: var(--n6-text-bg-red);
}

.n6-text-bg-red-important {
    background-color: var(--n6-text-bg-red)!important;
}

.n6-text-bg-yellow {
    background-color: var(--n6-highlight)!important;
}

.n6-text-bg-secondary {
    background-color: var(--bs-secondary-bg)!important;
}

.n6-small-number {
    color:var(--bs-gray-600);
}

.n6-medium-number {
    font-weight: lighter;
}

.n6-large-number {
    color: var(--bs-info);
}

/* Icon */
.n6-icon {
    cursor: pointer;
    padding-bottom: 1px;
    text-decoration: none;
}

.n6-struct-add {
    cursor: pointer;
}

.n6-struct-add i:hover{
    background-color: var(--n6-text-bg-green) !important;
}

.n6-icon:hover, .n6-dangling-icon:hover, .n6-empty-icon:hover {
    text-decoration: none;
}

.n6-inclusive {
    color: var(--n6-text-inclusive);
}

.n6-exclusive {
    color: var(--n6-text-exclusive);
}

.n6-icon:hover, .n6-dangling-icon:hover, .n6-empty-icon:hover {
    text-decoration: none;
}

.n6-background-icon {
    color: rgba(128, 128, 128, 0.08);
    font-size: 100px !important;
    position: absolute;
    right: 10px;
    bottom: 10px;
    pointer-events: none;
}

/* Avatar */
.avatar {
    --bs-avatar-width: 32px;
    position: relative;
    width: var(--bs-avatar-width);
    height: var(--bs-avatar-width);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 14px;
    border-radius: 50%;
    -o-object-fit: cover;
    object-fit: cover;
    color: white;
    background-color: var(--env);
}

/* File upload */
.n6-file-drop-area {
    padding: 3px 5px 5px 5px;
    border: dashed 1px #b5b5b5;
    font-size: 80%;
    cursor: pointer;
}

.n6-file-drop-area:hover {
    border:solid 1px;
}

.n6-download-from-fabric {
    padding: 1px 5px 2px 5px;
    border: dashed 1px #b5b5b5;
    font-size: 80%;
    background-color: #ffffff;
    color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
}
.n6-download-from-fabric:hover {
    border:solid 1px;
}


.n6-drag {
    background-color: var(--n6-drag-bg);
}

.n6-drag td {
    background-color: var(--n6-drag-bg);
}

.n6-drag-handle:hover {
    cursor: grab;
}

.n6-drag-handle:active {
    cursor: grabbing;
}

.n6-drag-handle {
    color: var(--bs-primary);
}

/* Badge */
.n6-badge {
    padding: .2em .4em;
    font-size: .8rem;
}

.text-bg-success {
    background-color: var(--bs-success) !important;
}

a {
    text-decoration: none;
}

.n6-hyperlink .material-icons {
    margin-right: 4px;
}

.n6-hyperlink:hover {
    text-decoration: underline;
}

.n6-image-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.n6-highlight,.n6-today {
    color:var(--n6-highlight-text);
    background-color: var(--n6-highlight);
}

.n6-hover-highlight:hover {
    background-color:  var(--n6-drag-bg);
}

/* link button */
.n6-button-link {
    background: none!important;
    border: none;
    padding: 0!important;
    cursor: pointer;
}

/* keyboard shortcuts */
kbd {
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.1em 0.5em;
    margin: 0 0.2em;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px #fff inset;
    background-color: #f7f7f7;
}


/* content-editable */
.n6-empty-editable {
    display: block !important;
}

.n6-editable:hover {
    /*noinspection CssUnknownTarget*/
    cursor: url('/static/images/edit.png') 1 30, crosshair
}

.n6-editable-cell, .n6-editable-cell .card-body {
    background-color: var(--n6-editable-background) !important;
}

.n6-editable-dateTime {
    width: 180px;
    background-color: #f2f2f2;
}

.n6-mandatory::after {
    content: " *";
    color: var(--bs-danger); /* Using Bootstrap danger (corporate brand red) */
}

.n6-optional::after {
    content: " *";
    visibility: hidden;
    white-space: nowrap;
}

.n6-modified {
    background: var(--n6-text-bg-green) !important;
    min-width: 10px;
}

.n6-added, .n6-added .n6-editable span, .n6-added .n6-modified {
    background:var(--n6-text-bg-green);
}

.n6-array-add,.n6-array-add td {
    background:var(--n6-text-bg-green);
}

.n6-marked-for-remove, .n6-marked-for-remove .n6-modified, .n6-marked-for-remove .card-body, .n6-marked-for-remove {
    background:var(--n6-text-bg-red);
}

.n6-marked-for-remove, .n6-marked-for-remove span {
    color: #9a3935;
    text-decoration: line-through;
    background:var(--n6-text-bg-red);
}

.n6-marked-for-remove .badge {
    background-color: #878787;
    text-decoration: line-through;
}

.n6-marked-for-remove input {
    text-decoration: line-through;
    background:var(--n6-text-bg-red);
}

.n6-modified-previous {
    text-decoration: line-through;
    background:var(--n6-text-bg-red);
}

.n6-savebar-env {
    margin-left: 8px;
    margin-right: 16px;
    color: var(--env);
    font-weight: bold;
}

.n6-disabled{
    opacity: 0.65;
}

.progress {
    height: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    background-color: #f5f5f5;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

.progress-bar {
    float: left;
    width: 0%;
    height: 100%;
    font-size: 12px;
    line-height: 20px;
    color: #fff;
    text-align: center;
    background-color: #337ab7;
    -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
    -webkit-transition: width .6s ease;
    -o-transition: width .6s ease;
    transition: width .6s ease;
}

/* TomSelect: Prevent input from wrapping to new line in single-select and when few items are selected */
.ts-wrapper.single .ts-control {
    flex-wrap: nowrap;
}

ins {
    background: var(--n6-text-bg-green) !important;
}

ins::before {
    content: "+";
    text-decoration: none;
    display: inline-block;
    padding-right: 8px;
    padding-left: 4px;
}

del {
    background:var(--n6-text-bg-red);
}

del::before {
    content: "-";
    text-decoration: none;
    display: inline-block;
    padding-right: 8px;
    padding-left: 4px;
}

.n6-active-outline.active {
    outline: 2px dotted var(--bs-primary);
    outline-offset: 1px;
}

/* Bootstrap Modal: control display via CSS classes to avoid CSP inline style violations.
   Bootstrap adds .modal-open to body BEFORE _showElement runs, so .modal-open .modal keeps
   the element visible in layout during the fade-in reflow. It also keeps it visible during
   fade-out (until _hideModal fires), at which point modal-open is removed by Bootstrap.
   scrollbar-gutter: stable replaces Bootstrap's JS-based padding compensation (_adjustDialog). */
html { scrollbar-gutter: stable; }
/* .n6-modal-active is added by the _showElement patch before the original runs (display during show).
   .modal.show overrides Bootstrap's .modal { display: none } with higher specificity (0,2,0 vs 0,1,0)
   as a safety net for the fade transition and for triggerOnLoad modals swapped in via HTMX.
   NOTE: do NOT use .modal-open .modal { display: block } — that would reveal all modals on the page
   whenever any one of them is open. */
.n6-modal-active { display: block; }
.modal.show { display: block; }

/* Inner flex wrapper used inside .modal-content as the HTMX swap target for clickToEdit modals.
   Keeping .modal-content (and the outer div.modal.fade) in the DOM means Bootstrap never
   closes/reopens the modal when Edit is clicked — no flicker. */
.n6-modal-inner {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* CSP-safe replacement for style="cursor:pointer" inline styles */
.n6-cursor-pointer { cursor: pointer; }

