/* ── Color Scheme Definitions (html[] specificity beats :root from package) ── */

html[knm-accent-color="blue"] {
    --knm-primary: #2457d6;
    --knm-primary-rgb: 36, 87, 214;
    --knm-primary-hover: #1d47b3;
    --knm-primary-active: #183c96;
    --knm-primary-subtle: #e6edfb;
    --knm-primary-text: #2457d6;
}

html[knm-accent-color="red"] {
    --knm-primary: #dc3545;
    --knm-primary-rgb: 220, 53, 69;
    --knm-primary-hover: #bb2d3b;
    --knm-primary-active: #b02a37;
    --knm-primary-subtle: #f8d7da;
    --knm-primary-text: #b02a37;
}

html[knm-accent-color="green"] {
    --knm-primary: #198754;
    --knm-primary-rgb: 25, 135, 84;
    --knm-primary-hover: #157347;
    --knm-primary-active: #146c43;
    --knm-primary-subtle: #d1e7dd;
    --knm-primary-text: #146c43;
}

html[knm-accent-color="purple"] {
    --knm-primary: #6f42c1;
    --knm-primary-rgb: 111, 66, 193;
    --knm-primary-hover: #5a32a3;
    --knm-primary-active: #54309a;
    --knm-primary-subtle: #e2d9f3;
    --knm-primary-text: #5a32a3;
}

html[knm-accent-color="orange"] {
    --knm-primary: #fd7e14;
    --knm-primary-rgb: 253, 126, 20;
    --knm-primary-hover: #e96b0a;
    --knm-primary-active: #dc6508;
    --knm-primary-subtle: #ffe5d0;
    --knm-primary-text: #b45309;
}

html[knm-accent-color="teal"] {
    --knm-primary: #20c997;
    --knm-primary-rgb: 32, 201, 151;
    --knm-primary-hover: #1baa80;
    --knm-primary-active: #19a077;
    --knm-primary-subtle: #d2f4ea;
    --knm-primary-text: #0f766e;
}

/* ── Bootstrap Bridge: map --knm-primary to Bootstrap utility classes ── */

.btn-primary {
    --bs-btn-bg: var(--knm-primary);
    --bs-btn-border-color: var(--knm-primary);
    --bs-btn-hover-bg: var(--knm-primary-hover);
    --bs-btn-hover-border-color: var(--knm-primary-hover);
    --bs-btn-active-bg: var(--knm-primary-active);
    --bs-btn-active-border-color: var(--knm-primary-active);
    --bs-btn-disabled-bg: var(--knm-primary);
    --bs-btn-disabled-border-color: var(--knm-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--knm-primary);
    --bs-btn-border-color: var(--knm-primary);
    --bs-btn-hover-bg: var(--knm-primary);
    --bs-btn-hover-border-color: var(--knm-primary);
    --bs-btn-active-bg: var(--knm-primary);
    --bs-btn-active-border-color: var(--knm-primary);
}

.text-primary { color: var(--knm-primary) !important; }
.bg-primary { background-color: var(--knm-primary) !important; }
.border-primary { border-color: var(--knm-primary) !important; }
.link-primary { color: var(--knm-primary); }
.link-primary:hover { color: var(--knm-primary-hover); }

.spinner-border.text-primary { color: var(--knm-primary) !important; }

.form-check-input:checked {
    background-color: var(--knm-primary, var(--bs-primary));
    border-color: var(--knm-primary, var(--bs-primary));
}

.form-check-input:focus {
    border-color: var(--knm-primary, var(--bs-primary));
    box-shadow: 0 0 0 0.25rem rgba(var(--knm-primary-rgb, 13, 110, 253), 0.25);
}

/* ── Form controls: focus, selection, select dropdown ── */

.form-control:focus,
.form-select:focus {
    border-color: var(--knm-primary, var(--bs-primary));
    box-shadow: 0 0 0 0.25rem rgba(var(--knm-primary-rgb, 13, 110, 253), 0.25);
}


/* ── QR Code theming (KNM.RazorComponents v1.5.1+) ── */

.knm-qrcode {
    --knm-qr-background: transparent !important;
    --knm-qr-foreground: var(--bs-body-color) !important;
    --knm-qr-outer-eye: var(--knm-primary, var(--bs-primary)) !important;
}

/* ── Global link color bridge ── */
html[knm-accent-color] {
    --bs-link-color: var(--knm-primary);
    --bs-link-color-rgb: var(--knm-primary-rgb);
    --bs-link-hover-color: var(--knm-primary-hover);
    --bs-link-hover-color-rgb: var(--knm-primary-rgb);
}

/* ── Light Mode Defaults ── */

[data-bs-theme="light"] {
    --bs-body-bg: #f5f7fa;
    --bs-border-color: #e4e7ec;
}

[data-bs-theme="light"] .card {
    --bs-card-bg: #fff;
}

/* ══════════════════════════════════════════════════════════════════════
   Header
   ══════════════════════════════════════════════════════════════════════ */

.knm-header {
    z-index: 1020;
    background-color: var(--bs-body-bg);
}

.knm-header-sticky {
    position: sticky;
    top: 0;
}

.knm-header .container-fluid.border-bottom {
    border-bottom-color: var(--bs-border-color) !important;
}

.knm-header .container-fluid > .d-flex {
    min-height: 56px;
}

/* ── Header Navigation ── */

.knm-header-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.knm-header-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--bs-body-color);
    opacity: 0.65;
    text-decoration: none;
    font-size: 0.875rem;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.knm-header-nav .nav-link:hover {
    opacity: 1;
    color: var(--knm-primary);
}

.knm-header-nav .nav-link.active {
    opacity: 1;
    font-weight: 600;
}

/* ── Vertical Divider ── */

.knm-header-nav .vr {
    opacity: 0.15;
}

/* ══════════════════════════════════════════════════════════════════════
   Avatar
   ══════════════════════════════════════════════════════════════════════ */

.knm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
}

.knm-avatar-md {
    width: 36px;
    height: 36px;
}

.knm-avatar-sm {
    width: 28px;
    height: 28px;
}

/* ══════════════════════════════════════════════════════════════════════
   Breadcrumb
   ══════════════════════════════════════════════════════════════════════ */

.breadcrumb {
    font-size: 0.8125rem;
    --knm-breadcrumb-color: var(--knm-primary, var(--bs-primary));
    --knm-breadcrumb-hover-color: var(--knm-primary-hover, var(--bs-link-hover-color));
    --knm-breadcrumb-active-color: var(--bs-body-color);
    --knm-breadcrumb-separator-color: var(--bs-secondary-color);
}

/* ── DataGrid header hover ── */

/* ── DataGrid accent theming ── */
/* v1.5.7.5: grid natively reads --knm-primary, override no longer needed */

/* ── Audit Footer accent ── */
.knm-audit-footer {
    --knm-audit-footer-text: var(--knm-primary, var(--bs-primary)) !important;
    --knm-audit-footer-icon: var(--knm-primary, var(--bs-primary)) !important;
}

/* ══════════════════════════════════════════════════════════════════════
   Dropdown
   ══════════════════════════════════════════════════════════════════════ */

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.dropdown-item.active {
    background-color: var(--knm-primary, var(--bs-primary)) !important;
    border-color: var(--knm-primary, var(--bs-primary)) !important;
    color: var(--knm-on-primary) !important;
}

.dropdown-item:active {
    background-color: var(--knm-primary, var(--bs-primary)) !important;
    color: var(--knm-on-primary) !important;
}

/* ══════════════════════════════════════════════════════════════════════
   Main Layout Wrapper
   ══════════════════════════════════════════════════════════════════════ */

/* ── Color Swatch Selector ── */

.knm-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    background-color: var(--swatch-color);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    padding: 0;
    outline: none;
}

.knm-color-swatch:hover,
.knm-color-swatch:focus,
.knm-color-swatch.knm-color-swatch-active {
    transform: scale(1.1);
    border-color: var(--bs-body-bg);
    box-shadow: 0 0 10px 3px color-mix(in srgb, var(--swatch-color) 45%, transparent) !important;
}

/* ── List Group Active (follows accent color) ── */

.list-group-item.active {
    background-color: var(--knm-primary, var(--bs-primary));
    border-color: var(--knm-primary, var(--bs-primary));
}

/* ── Swatch Colors ── */

.knm-color-swatch.blue    { --swatch-color: #2457d6; }
.knm-color-swatch.red     { --swatch-color: #dc3545; }
.knm-color-swatch.green   { --swatch-color: #198754; }
.knm-color-swatch.purple  { --swatch-color: #6f42c1; }
.knm-color-swatch.orange  { --swatch-color: #fd7e14; }
.knm-color-swatch.teal    { --swatch-color: #20c997; }

/* ══════════════════════════════════════════════════════════════════════
   Main Layout Wrapper
   ══════════════════════════════════════════════════════════════════════ */

.knm-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════════════
   Footer
   ══════════════════════════════════════════════════════════════════════ */

.knm-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--bs-border-color);
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}

/* ══════════════════════════════════════════════════════════════════════
   Dark Mode Overrides
   ══════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] {
    --bs-body-bg: #0f1420;
    --bs-secondary-bg: #1a2130;
    --bs-tertiary-bg: #141a27;
    --bs-body-color: #e4e7ec;
    --bs-secondary-color: #98a2b3;
    --bs-border-color: #283044;
}

[data-bs-theme="dark"] .card {
    --bs-card-bg: #1a2130;
}

[data-bs-theme="dark"] .knm-header {
    background-color: #0f1420;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .knm-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .dropdown-menu {
    --bs-dropdown-bg: #2a2f3a;
    --bs-dropdown-border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .table {
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}

/* ══════════════════════════════════════════════════════════════════════
   Login Page
   ══════════════════════════════════════════════════════════════════════ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-tertiary-bg, #f0f4f7);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

/* ══════════════════════════════════════════════════════════════════════
   Card Refinements
   ══════════════════════════════════════════════════════════════════════ */

.card {
    --bs-card-border-color: var(--bs-border-color) !important;
    --bs-card-border-radius: var(--knm-radius-card);
    box-shadow: none !important;
}

[data-bs-theme="dark"] .card {
    --bs-card-border-color: var(--bs-border-color);
    background-color: var(--bs-secondary-bg);
}

/* ── KNM Card Style Override (clean header, no bg/border) ── */

.card-header {
    background-color: transparent !important;
    border-bottom: none !important;
}

/* ══════════════════════════════════════════════════════════════════════
   Utilities
   ══════════════════════════════════════════════════════════════════════ */

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.border-start-4 {
    border-left-width: 4px !important;
}

.btn-transparent {
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.1);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: rgba(255, 255, 255, 0.15);
    --bs-btn-active-border-color: transparent;
    --bs-btn-color: inherit;
}

.progress-thin {
    height: 4px;
}

/* ══════════════════════════════════════════════════════════════════════
   Smooth Page Transitions
   ══════════════════════════════════════════════════════════════════════ */

.knm-wrapper > .body {
    animation: knm-fade-in 0.15s ease;
}

@keyframes knm-fade-in {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* ── Small chip variant for DataGrid cells ── */

.knm-chip-sm {
    --knm-chip-height: 1.4rem;
    --knm-chip-font-size: 0.7rem;
    --knm-chip-padding-x: 0.5rem;
}

 #knm-loading {
            position: fixed;
            inset: 0;
            z-index: 9999;
            background: var(--bs-body-bg, #1e293b);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.3s ease;
        }
        #knm-loading.loaded { opacity: 0; pointer-events: none; }
        .knm-loading-spinner {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(255,255,255,0.15);
            border-top-color: var(--knm-accent, #0d6efd);
            border-radius: 50%;
            animation: knm-spin 0.6s linear infinite;
        }
        @keyframes knm-spin { to { transform: rotate(360deg); } }
/* License terms (create wizard step 3 + edit drawer), software and module forms: sections stacked with a steady gap */
.knm-license-terms {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ══════════════════════════════════════════════════════════════════════
   PageHeading (Components/Shared/PageHeading.razor): the one header of every page, same shape as KoNiMa Tickets.
   A card with the icon in a square tinted with the accent, the title, the subtitle in the secondary colour and the
   page's buttons on the right of the title's row; on a phone the buttons wrap under the text at full width.
   ══════════════════════════════════════════════════════════════════════ */

.knm-page-heading {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--knm-border-radius, .375rem);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

[data-bs-theme="light"] .knm-page-heading { background: var(--bs-card-bg, var(--bs-white)); }
[data-bs-theme="dark"] .knm-page-heading { background: var(--bs-secondary-bg); }

.knm-page-heading__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
}

.knm-page-heading__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--knm-border-radius, .375rem);
    background: rgba(var(--knm-primary-rgb), .12);
    color: var(--knm-primary);
    font-size: 1.35rem;
    line-height: 1;
}

.knm-page-heading__text { flex: 1 1 12rem; min-width: 0; }

.knm-page-heading__title {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
    overflow-wrap: anywhere;
}

.knm-page-heading__subtitle {
    color: var(--bs-secondary-color);
    font-size: .85rem;
    margin-top: .2rem;
}

.knm-page-heading__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    margin-left: auto;
}

.knm-page-heading__extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: .75rem;
}

/* Actions or a second row whose content draws nothing in this state (a button behind an @if) take no room. */
.knm-page-heading__actions:not(:has(*)),
.knm-page-heading__extra:not(:has(*)) { display: none; }

.knm-page-heading__row:has(> .knm-page-heading__icon) + .knm-page-heading__extra { padding-left: 3.75rem; }

@media (max-width: 575.98px) {
    .knm-page-heading__actions { flex: 1 1 100%; justify-content: stretch; margin-left: 0; }
    .knm-page-heading__actions > * { flex: 1 1 auto; }
    .knm-page-heading__row:has(> .knm-page-heading__icon) + .knm-page-heading__extra { padding-left: 0; }
}

/* LoadingBlock: the skeleton drawn in place of a data area while it loads. */
.knm-loading-block { padding: 1rem 0; }

/* A read-only label/value pair in a detail modal (license, request): label small and muted, value below. */
.knm-detail-label {
    color: var(--bs-secondary-color);
    font-size: .8rem;
    margin-bottom: .2rem;
}

.knm-detail-value {
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Header bar (MainLayout): its minimum height. */
.knm-header-bar { min-height: 56px; }

/* Large check mark of a completed flow (license created). */
.knm-result-mark { font-size: 3rem; }

/* Error and not-found pages: one centred card, at most 500px wide. */
.knm-status-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.knm-status-page > * {
    width: 100%;
    max-width: 500px;
}

/* Profile: the section tabs stay in view while the section scrolls (below the header bar). */
.knm-profile-nav {
    position: sticky;
    top: 5rem;
}

/* Profile, MFA setup: the manual key box is no wider than the QR code above it. */
.knm-profile-manual-key { max-width: 340px; }

/* ══════════════════════════════════════════════════════════════════════
   Redesign 2026-11 (docs/superpowers/specs/2026-11-27-portal-redesign-design.md)
   One accent, 6px on controls and 8px on cards, flat surfaces with a 1px border, sections without boxes,
   status as a dot on a soft background. Everything is a variable so the dark theme only swaps values.
   ══════════════════════════════════════════════════════════════════════ */

:root {
    --knm-radius-control: 6px;
    --knm-radius-card: 8px;
    --knm-border-radius: var(--knm-radius-control);
    --knm-on-primary: #fff;
    --knm-surface: #fff;
    --knm-surface-muted: #f9fafb;

}

[data-bs-theme="dark"] {
    --knm-surface: #1a2130;
    --knm-surface-muted: #141a27;
}

/* Text painted in the accent must stay readable on the dark surfaces. */
html[data-bs-theme="dark"][knm-accent-color] {
    --knm-primary-text: color-mix(in srgb, var(--knm-primary) 55%, #fff);
    --bs-link-color: var(--knm-primary-text);
}

.btn { --bs-btn-border-radius: var(--knm-radius-control); }

/* An icon-only link button (row «⋯», copy, close) is an action, not a link in a sentence: no underline. */
.btn-link:has(> i:only-child), .btn-link:not(:has(:not(i))) { text-decoration: none; }
.form-control, .form-select, .input-group-text { border-radius: var(--knm-radius-control); }

/* KNMFieldset everywhere: no box and no accent stripe. The legend is a small uppercase heading and consecutive
   sections are separated by a thin rule. Doubled class: the library sets these variables on .knm-fieldset itself. */
.knm-fieldset.knm-fieldset {
    --knm-fieldset-border-width: 0;
    --knm-fieldset-accent-width: 0;
    --knm-fieldset-padding: 0;
    --knm-fieldset-bg: transparent;
    --knm-fieldset-legend-font-size: .75rem;
    --knm-fieldset-legend-font-weight: 600;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.knm-fieldset.knm-fieldset > .knm-fieldset-legend {
    /* Floated so the fieldset's top rule runs above it instead of being cut by the legend. */
    float: left;
    width: 100%;
    padding: 0;
    margin: 0 0 .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bs-secondary-color);
    background: none;
    border: 0;
}

.knm-fieldset.knm-fieldset > .knm-fieldset-body { padding: 0; clear: both; }

.knm-fieldset + .knm-fieldset,
.knm-license-terms > .knm-fieldset ~ .knm-fieldset {
    border-top: 1px solid var(--bs-border-color);
    padding-top: 1rem;
}

/* Status (KNMBadge Subtle + this class): a dot in the badge's colour before the text. */
.knm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: 999px;
    font-weight: 600;
}

.knm-status-badge::before {
    content: "";
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: currentColor;
}

/* Filter chips over a list: the status choices with their counts. */
.knm-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.knm-filter-chips .knm-filter-chip__count {
    margin-left: .35rem;
    font-weight: 600;
    opacity: .75;
}

/* Detail page: label/value pairs as a definition list, hint in words under the value. */
.knm-dl {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) 1fr;
    gap: .75rem 1.5rem;
    margin: 0;
}

.knm-dl > dt {
    color: var(--bs-secondary-color);
    font-weight: 500;
    font-size: .875rem;
}

.knm-dl > dd { margin: 0; overflow-wrap: anywhere; }
.knm-dl__hint { display: block; color: var(--bs-secondary-color); font-size: .8rem; margin-top: .15rem; }

@media (max-width: 575.98px) {
    .knm-dl { grid-template-columns: 1fr; gap: .25rem; }
    .knm-dl > dd { margin-bottom: .5rem; }
}

/* Detail page header: title row with status and key, actions on the right. */
.knm-detail-head__key {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .875rem;
}

/* Right-hand edit drawer: header, scrolling body with the tabs, footer always visible. */
.knm-drawer-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.knm-drawer-form__head {
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.knm-drawer-form__title { font-size: 1.1rem; font-weight: 600; margin: 0; }
.knm-drawer-form__subtitle { color: var(--bs-secondary-color); font-size: .85rem; margin-top: .15rem; }

.knm-drawer-form__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.knm-drawer-form__foot {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--bs-border-color);
    background: var(--knm-surface);
}
/* The record's audit line (KNMAuditFooter), on its own band right above the buttons, like the modals' audit footer. */
.knm-drawer-form__audit {
    flex: 0 0 auto;
    padding: .5rem 1.25rem;
    border-top: 1px solid var(--bs-border-color);
    background: var(--knm-surface);
}

/* Inside the edit drawer (~560px) the half-width columns of the terms are too narrow for their help text. */
.knm-edit-drawer .knm-license-terms .col-md-6,
.knm-edit-drawer .knm-license-terms .col-sm-6 { flex: 0 0 100%; max-width: 100%; }

/* Radio cards: the visible mark (the label's ::after; the real input is hidden) sits in the middle of the card's
   height, not on its first line. */
.knm-radio-card .knm-radio-card__label::after {
    top: 50%;
    transform: translateY(-50%);
}

/* Light theme: the off state of the outlined switch and the field borders were too pale to see on #f5f7fa. */
html:not([data-bs-theme="dark"]) {
    --bs-border-color: #d0d5dd;
}
html:not([data-bs-theme="dark"]) .knm-toggle {
    /* Off track border and knob: a mid grey that reads on the light page and inside white cards. */
    --knm-toggle-inactive: #98a2b3;
}

/* Data grids: one surface from toolbar to footer. The table inherited the page background (#f5f7fa) while the toolbar
   was near-white, so the grid looked split in two. */
.knm-grid.knm-grid {
    background-color: var(--knm-surface);
    --bs-table-bg: var(--knm-surface);
}
.knm-grid .knm-grid-toolbar,
.knm-grid .knm-grid-footer { background-color: var(--knm-surface); }
/* The table sets its own --bs-table-bg (and the dark theme sets it again on .table): override it on the table itself. */
.knm-grid .table,
html[data-bs-theme="dark"] .knm-grid .table { --bs-table-bg: var(--knm-surface); }

/* Free text typed by a person (request notes, rejection reason): keep the line breaks they wrote. */
.knm-pre-line { white-space: pre-line; }

/* Module rows (KNMList): the value field keeps a fixed width so the switches line up in one column. */
.knm-feature-list .knm-feature-list__value { width: 9rem; }
.knm-feature-list .knm-field, .knm-feature-list .mb-3 { margin-bottom: 0 !important; }

/* Row hover in the accent, not grey (Nicola, 2026-11-27): a tint of the chosen accent, stronger on the dark surface. */
.knm-grid .table,
html[data-bs-theme="dark"] .knm-grid .table { --bs-table-hover-color: var(--bs-body-color); }
.knm-grid .table { --bs-table-hover-bg: rgba(var(--knm-primary-rgb), 0.07); }
html[data-bs-theme="dark"] .knm-grid .table { --bs-table-hover-bg: rgba(var(--knm-primary-rgb), 0.16); }

/* Quiet icon-only buttons (KNMButton Ghost, e.g. in the header): the hover is a tint of the accent, not grey. */
.knm-button--ghost:hover,
.knm-button--ghost:focus-visible { background-color: rgba(var(--knm-primary-rgb), .1); color: var(--knm-primary-text, var(--knm-primary)); }
html[data-bs-theme="dark"] .knm-button--ghost:hover,
html[data-bs-theme="dark"] .knm-button--ghost:focus-visible { background-color: rgba(var(--knm-primary-rgb), .2); }

/* Software modal: a steady height, so switching tab does not make the dialog jump. */
.knm-software-modal .modal-body { min-height: min(70vh, 640px); }

/* Software modal, editions tab: an open edition sits in a card whose header carries back, title and its own Save. */
.knm-edition-card__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.knm-edition-card__title { flex: 1 1 12rem; min-width: 0; margin: 0; font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.knm-edition-card__body { padding-top: .25rem; }

/* Plans of an edition (KNMAccordion): the summary in the header reads as one line, wrapping on a phone. */
.knm-plan-list .accordion-button { flex-wrap: wrap; row-gap: .25rem; }

/* Module rows on a phone: the controls go under the text instead of squeezing it. */
@media (max-width: 575.98px) {
    .knm-feature-list .knm-list-item { flex-wrap: wrap; }
    .knm-feature-list .knm-feature-list__value { width: 7rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   App shell (MainLayout): KNMSidebar on the left, the page column on the right
   The menu stays navy in both themes (spec: sidebar dark navy); the active entry and the hover are tints of the
   chosen accent, never grey. Above 768 px the sidebar sits in the flow and stays in view while the page scrolls;
   below 768 px KNMSidebar turns it into an overlay, opened by the header button.
   ══════════════════════════════════════════════════════════════════════ */

:root {
    --knm-app-sidebar-bg: #101828;
    --knm-app-sidebar-text: #a6b0c3;
    --knm-app-sidebar-text-strong: #fff;
    --knm-app-sidebar-title: #667085;
    --knm-app-sidebar-border: rgba(255, 255, 255, 0.08);
    /* Strength of the accent tint behind the hovered and the current entry. */
    --knm-app-sidebar-hover-alpha: 0.22;
    --knm-app-sidebar-active-alpha: 0.34;
}

/* The darker navy needs a stronger tint for the same contrast. */
[data-bs-theme="dark"] {
    --knm-app-sidebar-bg: #080c14;
    --knm-app-sidebar-hover-alpha: 0.3;
    --knm-app-sidebar-active-alpha: 0.42;
}

.knm-shell {
    display: flex;
    min-height: 100vh;
    /* Same height as the page header bar, so the two bottom borders line up (also places the edge button). */
    --knm-density-sidebar-header-min-height: 57px;
}

@media (min-width: 768px) {
    /* In view while the window scrolls; above the sticky page header, so the edge button and the hover
       expansion of the rail are not covered by it. */
    .knm-shell > .knm-sidebar-wrapper {
        position: sticky;
        top: 0;
        height: 100vh;
        align-self: flex-start;
        z-index: 1025;
    }

    /* Collapsed, the wrapper keeps the rail's width: the hover expansion then lays the menu over the page instead
       of pushing the page aside and back on every pass of the mouse. */
    .knm-shell > .knm-sidebar-wrapper:has(> .knm-sidebar--collapsed) { width: var(--knm-sidebar-mini-width); }}

/* The header button opens the phone overlay: KNMSidebar's own floating button would be a second one. */
.knm-shell .knm-sidebar-mobile-toggle { display: none; }

.knm-app-sidebar.knm-sidebar {
    background: var(--knm-app-sidebar-bg);
    color: var(--knm-app-sidebar-text);
    border-right-color: var(--knm-app-sidebar-border);
    --knm-sidebar-active-bg: rgba(var(--knm-primary-rgb), var(--knm-app-sidebar-active-alpha));
    --knm-sidebar-active-color: var(--knm-app-sidebar-text-strong);
    --knm-sidebar-active-font-weight: 600;
}

.knm-app-sidebar .knm-sidebar-header {
    height: var(--knm-density-sidebar-header-min-height);
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: var(--knm-app-sidebar-border);
}

.knm-app-sidebar .knm-sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.knm-app-sidebar .knm-sidebar-nav .nav-link {
    color: var(--knm-app-sidebar-text);
    margin-bottom: 2px;
}

.knm-app-sidebar .knm-sidebar-nav .nav-link:hover {
    background: rgba(var(--knm-primary-rgb), var(--knm-app-sidebar-hover-alpha));
    color: var(--knm-app-sidebar-text-strong);
}

.knm-app-sidebar .knm-sidebar-nav .nav-link.active:hover { background: var(--knm-sidebar-active-bg); }

/* The icon of the current page in a light shade of the accent, readable on the navy. */
.knm-app-sidebar .knm-sidebar-nav .nav-link.active i { color: color-mix(in srgb, var(--knm-primary) 45%, #fff); }

.knm-app-sidebar .knm-sidebar-nav .nav-link:focus-visible {
    outline: var(--knm-focus-width, 2px) solid var(--knm-primary);
    outline-offset: -2px;
}

/* Section title: fixed height, so the entries do not move when the rail expands on hover. */
.knm-app-sidebar .knm-nav-title {
    display: flex;
    align-items: flex-end;
    height: 2.25rem;
    padding: 0 var(--knm-density-sidebar-item-padding-x, .75rem) .375rem;
    color: var(--knm-app-sidebar-title);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

/* Brand: full logo when open, the favicon alone on the rail. The full logo sits in a span, which KNMSidebar hides
   on the rail and shows again while the rail is expanded on hover. */
.knm-app-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.knm-app-brand__full img {
    height: 40px;
    object-fit: contain;
}

.knm-app-brand__mini {
    display: none;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Edge button that collapses the sidebar: the accent on hover. */
.knm-shell .knm-sidebar-toggle:hover {
    background: var(--knm-primary);
    border-color: var(--knm-primary);
    color: var(--knm-on-primary);
}

@media (min-width: 768px) {
    .knm-sidebar--collapsed .knm-app-brand { justify-content: center; width: 100%; }
    .knm-sidebar--collapsed .knm-app-brand__mini { display: block; }
    .knm-sidebar--collapsed .knm-nav-title span { display: none; }

    /* On the rail a title is a thin rule between the groups. */
    .knm-sidebar--collapsed .knm-nav-title::before {
        content: "";
        flex: 1;
        margin-bottom: .6rem;
        border-top: 1px solid var(--knm-app-sidebar-border);
    }

    .knm-sidebar-wrapper:not(.knm-sidebar--no-hover):hover .knm-sidebar--collapsed .knm-app-brand { justify-content: flex-start; }
    .knm-sidebar-wrapper:not(.knm-sidebar--no-hover):hover .knm-sidebar--collapsed .knm-app-brand__mini { display: none; }
    .knm-sidebar-wrapper:not(.knm-sidebar--no-hover):hover .knm-sidebar--collapsed .knm-nav-title span { display: inline; }
    .knm-sidebar-wrapper:not(.knm-sidebar--no-hover):hover .knm-sidebar--collapsed .knm-nav-title::before { content: none; }
}

/* Header button that opens the phone overlay: the accent on hover, like the menu entries. */
.knm-header-toggler.btn:hover {
    color: var(--knm-primary-text);
    background: rgba(var(--knm-primary-rgb), 0.1);
}

/* ══════════════════════════════════════════════════════════════════════
   Dashboard (Components/Pages/Dashboard.razor)
   White cards on the page background; one colour carries data, the accent. Warning and danger only on «expiring»
   and «expired». Hover and focus are tints of the accent. The rows fold to one column under 992 px.
   ══════════════════════════════════════════════════════════════════════ */

.knm-dash {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.knm-dash-card.card {
    background: var(--knm-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--knm-radius-card);
    box-shadow: none;
    min-width: 0;
    height: 100%;
}

.knm-dash-card > .card-header {
    background: transparent;
    border-bottom: 0;
    padding: 1rem 1.25rem .25rem;
}

.knm-dash-card > .card-body { padding: .75rem 1.25rem 1.25rem; min-width: 0; }

.knm-dash-card > .card-footer {
    background: transparent;
    border-top: 1px solid var(--bs-border-color);
    padding: .5rem 1rem;
}

/* Card titles: the same size whether they come from KNMCard's Title or from a header with a control. */
.knm-dash-card .card-title,
.knm-dash-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.knm-dash-card .card-subtitle,
.knm-dash-card__subtitle {
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    font-weight: 400;
    margin-top: .15rem;
}

.knm-dash-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem 1rem;
}

.knm-dash-year { width: 7.5rem; }

/* A list card: the rows run to the card's edges. */
.knm-dash-card > .card-body.knm-dash-card__list { padding: .25rem 0 0; }

/* To do strip. */
.knm-dash-todo__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.knm-dash-todo__item {
    display: flex;
    align-items: center;
    gap: .875rem;
    height: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--knm-radius-card);
    color: var(--bs-body-color);
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
}

.knm-dash-todo__item:hover {
    background: rgba(var(--knm-primary-rgb), .06);
    border-color: rgba(var(--knm-primary-rgb), .45);
    color: var(--bs-body-color);
}

.knm-dash-todo__item:focus-visible {
    outline: 2px solid var(--knm-primary);
    outline-offset: 2px;
}

.knm-dash-todo__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.25rem;
}

.knm-dash-todo__icon--accent { background: rgba(var(--knm-primary-rgb), .12); color: var(--knm-primary-text); }
.knm-dash-todo__icon--warning { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.knm-dash-todo__icon--danger { background: var(--bs-danger-bg-subtle); color: var(--bs-danger); }

.knm-dash-todo__text { display: flex; flex-direction: column; min-width: 0; }
.knm-dash-todo__title { font-size: .9375rem; }
.knm-dash-todo__title strong { font-size: 1.25rem; font-weight: 600; margin-right: .15rem; }
.knm-dash-todo__hint { color: var(--bs-secondary-color); font-size: .8125rem; }

.knm-dash-todo__go {
    margin-left: auto;
    color: var(--bs-secondary-color);
    transition: transform .15s, color .15s;
}

.knm-dash-todo__item:hover .knm-dash-todo__go { color: var(--knm-primary-text); transform: translateX(2px); }

.knm-dash-todo__none {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--bs-secondary-color);
}

.knm-dash-todo__none i { color: var(--knm-primary-text); font-size: 1.25rem; }

/* KPI tiles: the same look for all four; the whole tile is the link (stretched-link on the label). */
.knm-dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.knm-dash-kpi.card { position: relative; transition: background-color .15s, border-color .15s; }
.knm-dash-kpi > .card-body { padding: 1rem 1.25rem; }

.knm-dash-kpi.card:hover {
    background: rgba(var(--knm-primary-rgb), .04);
    border-color: rgba(var(--knm-primary-rgb), .45);
}

.knm-dash-kpi.card:has(.stretched-link:focus-visible) {
    outline: 2px solid var(--knm-primary);
    outline-offset: 2px;
}

.knm-dash-kpi__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.knm-dash-kpi__label {
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    font-weight: 500;
    text-decoration: none;
}

.knm-dash-kpi__label:focus-visible { outline: 0; }
.knm-dash-kpi.card:hover .knm-dash-kpi__label,
.knm-dash-kpi.card:hover .knm-dash-kpi__icon { color: var(--knm-primary-text); }

.knm-dash-kpi__icon { color: var(--bs-secondary-color); font-size: 1.125rem; }

.knm-dash-kpi__value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.15;
    margin-top: .35rem;
    color: var(--bs-emphasis-color);
}

.knm-dash-kpi__value--na { color: var(--bs-secondary-color); }
.knm-dash-kpi__hint { color: var(--bs-secondary-color); font-size: .75rem; margin-top: .15rem; }
.knm-dash-kpi__skeleton { margin: .75rem 0 .5rem; }

/* Card rows. */
.knm-dash-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
    .knm-dash-row--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
    .knm-dash-row--two,
    .knm-dash-row--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .knm-dash-row--three > :last-child { grid-column: 1 / -1; }
}

@media (min-width: 1400px) {
    .knm-dash-row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .knm-dash-row--three > :last-child { grid-column: auto; }
}

@media (max-width: 991.98px) {
    .knm-dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .knm-dash-kpis { gap: .75rem; }
    .knm-dash-kpi > .card-body { padding: .875rem 1rem; }
    .knm-dash-kpi__value { font-size: 1.625rem; }
    .knm-dash-card > .card-header { padding: .875rem 1rem .25rem; }
    .knm-dash-card > .card-body { padding: .75rem 1rem 1rem; }
}

.knm-dash-chart { width: 100%; }

/* Lists on the dashboard: the hover is a tint of the accent, not the library's grey. */
.knm-dash .knm-list-item--clickable:hover { background: rgba(var(--knm-primary-rgb), .06); }
html[data-bs-theme="dark"] .knm-dash .knm-list-item--clickable:hover { background: rgba(var(--knm-primary-rgb), .14); }
.knm-dash-list .knm-list-item { padding: .625rem 1.25rem; }
.knm-dash-list .knm-list-item-action { display: inline-flex; align-items: center; gap: .25rem; }
/* «Scarica report»: a neutral outline whose hover and open state are a tint of the accent, not the grey fill. */
.btn.knm-dash-report {
    --bs-btn-hover-bg: rgba(var(--knm-primary-rgb), .08);
    --bs-btn-hover-border-color: var(--knm-primary);
    --bs-btn-hover-color: var(--knm-primary-text);
    --bs-btn-active-bg: rgba(var(--knm-primary-rgb), .14);
    --bs-btn-active-border-color: var(--knm-primary);
    --bs-btn-active-color: var(--knm-primary-text);
}

/* «Esamina» on the dark surface: the accent text shade, as the other accent texts there. */
html[data-bs-theme="dark"] .knm-dash .btn-outline-primary { --bs-btn-color: var(--knm-primary-text); --bs-btn-border-color: var(--knm-primary-text); }

/* Ranked bars: name and value on one line, an 8 px bar in the accent on a light step of the accent. */
.knm-dash-rank .knm-list-item { padding: .5rem .25rem; border-bottom: 0; }
.knm-dash-rank .knm-list-item--clickable { border-radius: var(--knm-radius-control); }
.knm-dash-rank .knm-list-item-content { flex-basis: 100%; }

.knm-dash-rank__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.knm-dash-rank__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.knm-dash-rank__value { font-weight: 600; font-variant-numeric: tabular-nums; }
.knm-dash-rank__other .knm-dash-rank__name { color: var(--bs-secondary-color); }

.knm-dash-rank .progress.knm-dash-rank__bar {
    --bs-progress-height: 8px;
    --bs-progress-bg: rgba(var(--knm-primary-rgb), .12);
    --bs-progress-border-radius: 4px;
    margin-top: .375rem;
}

html[data-bs-theme="dark"] .knm-dash-rank .progress.knm-dash-rank__bar { --bs-progress-bg: rgba(var(--knm-primary-rgb), .22); }


/* Row actions (gold standard, Components/Shared/RowActions.razor, same shape as KoNiMa Tickets): round icon buttons,
   right-aligned, on every grid. */
.knm-rowactions { display: flex; justify-content: flex-end; align-items: center; gap: 0.25rem; }
.knm-rowactions .btn {
    width: 2rem; height: 2rem; min-width: 2rem; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; line-height: 1;
}

/* Configurations page (layout copied from KoNiMa Tickets): the sections on the left (240 px), the chosen one's settings
   on the right. One column below 992 px, where the list gives way to a picker; each setting row stacks below 700 px. */
.knm-config-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.knm-config-nav { min-width: 0; padding: 1rem; border-bottom: 1px solid var(--bs-border-color); }
.knm-config-detail { min-width: 0; padding: 1rem 1.25rem; }
@media (min-width: 992px) {
    .knm-config-layout { grid-template-columns: 240px minmax(0, 1fr); }
    .knm-config-nav { padding-inline: .5rem; border-bottom: 0; border-inline-end: 1px solid var(--bs-border-color); background: var(--knm-surface-muted); }
}
.knm-config-nav .knm-list-item {
    --knm-list-item-padding: .4rem .6rem; --knm-list-item-border: 0; --knm-list-item-gap: .5rem; --knm-list-item-icon-size: 1rem;
    border-radius: var(--knm-radius-control);
}
.knm-config-nav .knm-list-item-icon { width: 1.25rem; }
/* Hover and the chosen section in the accent, never grey. */
.knm-config-nav .knm-list-item--clickable:hover { background: rgba(var(--knm-primary-rgb), .07); }
.knm-config-nav .knm-list-item--active,
.knm-config-nav .knm-list-item--active:hover { background: rgba(var(--knm-primary-rgb), .12); }
html[data-bs-theme="dark"] .knm-config-nav .knm-list-item--clickable:hover { background: rgba(var(--knm-primary-rgb), .16); }
html[data-bs-theme="dark"] .knm-config-nav .knm-list-item--active,
html[data-bs-theme="dark"] .knm-config-nav .knm-list-item--active:hover { background: rgba(var(--knm-primary-rgb), .24); }
.knm-config-nav .knm-list-item--active .knm-list-item-primary,
.knm-config-nav .knm-list-item--active .knm-list-item-icon { color: var(--knm-primary-text); font-weight: 600; }
.knm-config-nav-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-width: 0; }
.knm-config-nav-title { min-width: 0; overflow-wrap: anywhere; }
.knm-config-nav-counts { display: inline-flex; gap: .25rem; flex: 0 0 auto; }
.badge.knm-config-count { --knm-badge-bg: transparent; --knm-badge-color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color); font-weight: 500; }
/* «Modificato»: the accent, not Bootstrap's blue. */
.badge.knm-accent-badge { --knm-badge-bg: rgba(var(--knm-primary-rgb), .12); --knm-badge-color: var(--knm-primary-text); }
.knm-config-section + .knm-config-section { margin-top: 1.75rem; }
.knm-config-rows { margin-top: .75rem; }
.knm-config-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem 1.5rem; align-items: start;
    padding: .9rem 0 .9rem .75rem; border-top: 1px solid var(--bs-border-color); border-inline-start: 3px solid transparent; }
.knm-config-row--dirty { border-inline-start-color: var(--bs-warning); }
.knm-config-row__text { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.knm-config-row__control { min-width: 0; }
.knm-config-row__field { display: flex; align-items: flex-start; justify-content: flex-end; gap: .5rem; max-width: 100%; }
.knm-config-row__field .mb-3, .knm-config-row__field .knm-field { margin-bottom: 0 !important; }
.knm-config-row-editor { flex: 0 1 auto; min-width: 0; width: 280px; max-width: 100%; }
.knm-config-row-editor--compact { width: auto; max-width: 12rem; }
.knm-config-row-label { font-weight: 600; }
mark.knm-config-row-match { padding: 0 .1em; border-radius: .2em; background: rgba(var(--knm-primary-rgb), .18); color: inherit; }
.knm-config-row-details { cursor: help; }
.knm-config-row-reset.btn { width: 2.375rem; height: 2.375rem; min-width: 2.375rem; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; }
.knm-config-row-unsaved { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--bs-warning-text-emphasis); }
.knm-config-row-unsaved::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--bs-warning); }
.knm-config-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: .75rem 1rem; margin-top: 1rem; padding: .75rem 1rem;
    background: var(--knm-surface); border: 1px solid var(--bs-border-color); border-inline-start: 3px solid var(--bs-warning);
    border-radius: var(--knm-radius-card); box-shadow: 0 -4px 16px rgba(16, 24, 40, .08); }
.knm-config-savebar__text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.knm-config-savebar__actions { display: flex; gap: .5rem; margin-inline-start: auto; }
@media (max-width: 699.98px) {
    .knm-config-row { grid-template-columns: minmax(0, 1fr); }
    .knm-config-row__field { justify-content: flex-start; }
    .knm-config-row-editor { flex: 1 1 auto; width: auto; }
    .knm-config-row-editor--compact { flex: 0 0 auto; }
}
@media (max-width: 575.98px) {
    .knm-config-nav, .knm-config-detail { padding-inline: 12px; }
    .knm-config-row { padding-inline: 0; border-inline-start: 0; }
    .knm-config-savebar { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 0; border-inline: 0;
        border-top: 3px solid var(--bs-warning); padding: .75rem 16px calc(.75rem + env(safe-area-inset-bottom)); }
    .knm-config-savebar__actions { width: 100%; }
    .knm-config-savebar__actions .btn { flex: 1 1 0; }
    .knm-config-detail:has(.knm-config-savebar) { padding-bottom: 9rem; }
}

/* User drawer, sign-in block: one item per tool (password, two-step verification, API key), title and state on the
   left, its button on the right. */
.knm-user-security { display: flex; flex-direction: column; }
.knm-user-security__item { padding: .75rem 0; }
.knm-user-security__item + .knm-user-security__item { border-top: 1px solid var(--bs-border-color); }
.knm-user-security__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.knm-user-security__head .btn { flex: 0 0 auto; }

/* A key id in a grid cell: monospace, so 0/O and 1/l read apart. */
code.knm-key-id { color: inherit; font-size: .85em; }

/* README templates: the editor and its preview side by side, the language choice above them. */
.knm-readme-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; }
.knm-readme-toolbar .knm-readme-toolbar__field { flex: 1 1 14rem; min-width: 0; }
.knm-readme-toolbar .mb-3, .knm-readme-toolbar .knm-field { margin-bottom: 0 !important; }
.knm-readme-pane__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.knm-readme-pane__head .mb-3, .knm-readme-pane__head .knm-field { margin-bottom: 0 !important; }

/* Key encryption: the three counts in one row of tiles. */
.knm-enc-tile { text-align: center; }
.knm-enc-tile__value { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.knm-enc-tile__label { color: var(--bs-secondary-color); }
