﻿
.task-list-item input[type="checkbox"][disabled] {
}

    .task-list-item input[type="checkbox"][disabled]:checked {
        filter: brightness(0) saturate(100%) invert(61%) sepia(89%) saturate(2389%) hue-rotate(358deg) brightness(97%) contrast(110%);
    }

.task-list-item:has(input[type="checkbox"]:checked) {
    text-decoration: line-through;
    font-size: 0.7em;
}

.view-mode-toggle .view-mode-button {
    margin-right: 2px;
    /* compact: shrink the DevExpress button padding/typography so the toolbar is short and subtle */
    --dxbl-btn-padding-y: 0.1rem;
    --dxbl-btn-padding-x: 0.45rem;
    padding: 0.1rem 0.45rem !important;
    min-height: 0 !important;
    font-size: 0.7rem !important;
    line-height: 1.35 !important;
    font-weight: 500;
}

    .view-mode-toggle .view-mode-button:last-child {
        margin-right: 0;
    }

    /* smaller glyphs to match the compact buttons */
    .view-mode-toggle .view-mode-button .icon-edit,
    .view-mode-toggle .view-mode-button .icon-both,
    .view-mode-toggle .view-mode-button .icon-preview {
        width: 13px;
        height: 13px;
    }

.icon-edit {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4H4C3.46957 4 2.96086 4.21071 2.58579 4.58579C2.21071 4.96086 2 5.46957 2 6V18C2 18.5304 2.21071 19.0391 2.58579 19.4142C2.96086 19.7893 3.46957 20 4 20H16C16.5304 20 17.0391 19.7893 17.4142 19.4142C17.7893 19.0391 18 18.5304 18 18V11' stroke='%23F19E39' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' /%3E%3Cpath d='M18.5 2.50023C18.8978 2.1024 19.4374 1.87891 20 1.87891C20.5626 1.87891 21.1022 2.1024 21.5 2.50023C21.8978 2.89805 22.1213 3.43762 22.1213 4.00023C22.1213 4.56284 21.8978 5.1024 21.5 5.50023L12 15.0002L8 16.0002L9 12.0002L18.5 2.50023Z' stroke='%23F19E39' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.icon-both {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3V21M3 12H21' stroke='%23F19E39' stroke-width='2' stroke-linecap='round' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.icon-preview {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 12C1 12 5 4 12 4C19 4 23 12 23 12C23 12 19 20 12 20C5 20 1 12 1 12Z' stroke='%23F19E39' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' /%3E%3Ccircle cx='12' cy='12' r='3' stroke='%23F19E39' stroke-width='2' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}


/* Markdown Editor Styles */
.markdown-editor-container {
    /* Height comes from the view item's model RowCount (set inline as --md-editor-height by the
       component: rows * line + chrome). Falls back to 80vh when RowCount is unset. The popup rule
       below overrides this with height:100% so the editor still fills & tracks a resizable dialog. */
    height: var(--md-editor-height, 80vh);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
}

/* --- Fill & track a resizable XAF popup detail view (e.g. Issue -> New) ------------------------
   In an in-tab detail view the 80vh above is fine. In a popup we want the editor to fill the dialog
   and follow drag-resize. Verified live popup DOM (DevExpress 26.1):
     dxbl-modal-dialog.dxbl-popup > .dxbl-modal-content(flex col) > .dxbl-modal-body(flex:1 1 auto)
       > .main > .main-content > .detail-view-content > .dxbl-fl(flex col) > .dxbl-row
       > .dxbl-fl-group(> .dxbl-group > .dxbl-group-body > .dxbl-group-body-content) > .dxbl-row
       > .dxbl-fl-item > .dxbl-fl-ctrl > .markdown-editor-container
   .dxbl-modal-body already has a real, resize-tracking height, but everything below it is block /
   flex:0 0 auto so that height never reaches the editor; and the dialog has only min/max height set
   (auto), which is why a naive height:100% collapsed. Fix: (A) give the dialog a definite height —
   drag-resize writes an inline px height that overrides this, so the editor tracks the drag; (B) turn
   the block wrappers on the path into filling flex columns; (C) neutralise the theme's flex-grow on
   NON-path rows/groups so sibling fields keep their natural height and only the editor takes the slack.
   All keyed on :has(.markdown-editor-container) inside the modal, so only this popup is affected;
   in-tab detail views (no .dxbl-modal ancestor) keep the 80vh above. min-height:0 lets each flex node
   shrink so the editor's own scroller works. */

/* (A) definite dialog height (resize writes inline height -> overrides -> editor follows the drag) */
dxbl-modal-dialog:has(.markdown-editor-container) {
    height: 78vh;
}

/* (C) inside this popup, fields don't grow; only the editor's path is re-grown by the rules below. */
.dxbl-modal-content:has(.markdown-editor-container) .dxbl-row,
.dxbl-modal-content:has(.markdown-editor-container) .dxbl-fl-group {
    flex-grow: 0;
}

    /* (B) block wrappers on the path -> filling flex columns. Includes the DevExpress TabbedGroup layers
   (.dxbl-fl-gt > .dxbl-tabs > .dxbl-tabs-content-panel > .dxbl-tabs-content > .dxbl-fl-tab-content)
   so height crosses a tab boundary when the editor lives on a tab; :has() keeps inactive tabs out. */
    .dxbl-modal-content:has(.markdown-editor-container) > .dxbl-modal-body,
    .dxbl-modal-content:has(.markdown-editor-container) .main,
    .dxbl-modal-content:has(.markdown-editor-container) .main-content,
    .dxbl-modal-content:has(.markdown-editor-container) .detail-view-content,
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-fl:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-fl-group:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-group:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-group-body:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-group-body-content:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-fl-gt:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-tabs:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-tabs-content-panel:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-tabs-content:has(.markdown-editor-container),
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-fl-tab-content:has(.markdown-editor-container) {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
    }

    /* path rows: grow vertically, allow shrink (keep their horizontal direction for fields). */
    .dxbl-modal-content:has(.markdown-editor-container) .dxbl-row:has(.markdown-editor-container) {
        flex: 1 1 auto;
        min-height: 0;
    }

/* the item holding the editor is a horizontal caption|control layout (flex-direction:row), so the
   control doesn't stretch to the item's height. Force the item to a column so the control fills it
   on the main axis. (A caption, if any, stacks above the editor instead of beside it.) */
.dxbl-modal-content:has(.markdown-editor-container) .dxbl-fl-item:has(.markdown-editor-container) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.dxbl-modal-content:has(.markdown-editor-container) .dxbl-fl-ctrl:has(.markdown-editor-container) {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

/* (D) editor fills its control wrapper instead of a fixed vh. */
.dxbl-modal-content:has(.markdown-editor-container) .markdown-editor-container {
    height: 100%;
    min-height: 0;
}

/* --- Opt-in full-height in a regular / split (non-popup) detail view -----------------------------
   Set the view item's model RowCount to 100 (sentinel) to make the editor fill its detail-view pane
   instead of using a fixed row height. The component tags the container .md-fill; this rebuilds the
   height chain through the master-detail detail view (mirrors the popup chain, anchored at the scroll
   host via min-height:100% so it still scrolls when genuinely cramped). Gated on .md-fill, so only
   views that opt in are affected; anchored at .xaf-masterdetail-detailview-holder, so popups (no
   holder) keep their own always-fill behavior. */
.markdown-editor-container.md-fill {
    height: 100%;
}

.xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

    /* fields don't grow; only the editor's path is re-grown below */
    .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-row,
    .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-fl-group,
    .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-fl-item {
        flex-grow: 0;
    }

        /* block wrappers + TabbedGroup layers on the path -> filling flex columns */
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) > .detail-view-content,
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-fl:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-fl-group:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-group:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-group-body:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-group-body-content:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-fl-gt:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-tabs:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-tabs-content-panel:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-tabs-content:has(.markdown-editor-container.md-fill),
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-fl-tab-content:has(.markdown-editor-container.md-fill) {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
            height: auto;
        }

        /* path rows: stack as a column so the editor's group flex-grows into the remaining height instead of
   sharing a wrapped line 50/50 with a sibling field (dxbl-row wraps full-width children onto separate
   lines, and align-content splits the height evenly — that was the ~50% in Edit mode). Sibling fields
   keep natural height (flex-grow:0 above); the editor's group (re-grown below) takes the slack. */
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-row:has(.markdown-editor-container.md-fill) {
            flex: 1 1 auto;
            min-height: 0;
            flex-direction: column;
            flex-wrap: nowrap;
        }

        /* horizontal item -> column so the control fills */
        .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-fl-item:has(.markdown-editor-container.md-fill) {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
        }

    .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .dxbl-fl-ctrl:has(.markdown-editor-container.md-fill) {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }

    /* The container fills the control wrapper via FLEX (not height:100%). Under md-fill the chain is
   anchored on min-height:100% (flex-derived heights), so a percentage height:100% on the container
   doesn't resolve and collapses to content — flex:1 1 auto fills off the used height instead. */
    .xaf-masterdetail-detailview-holder:has(.markdown-editor-container.md-fill) .markdown-editor-container.md-fill {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
    }

/* Hide the header but keep it in DOM for now */
.editor-header {
    display: none;
}

/* Three view-mode buttons as the first row of the editor, right-aligned. Kept in normal flow
   rather than floated above the container: PRC's KBA detail view has no gap above the editor,
   so an absolutely-positioned toggle landed on the Name row. Dimmed at rest, full on hover. */
.view-mode-toggle {
    align-self: flex-end;
    margin-bottom: 0.25rem;
    display: flex !important;
    gap: 2px;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}
    .view-mode-toggle:hover {
        opacity: 1;
    }

.editor-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.view-mode-edit .preview-pane {
    display: none;
}

.view-mode-preview .editor-pane {
    display: none;
}

.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.view-mode-both .editor-pane,
.view-mode-both .preview-pane {
    border-right: 1px solid var(--dxds-color-border-neutral-default-rest, var(--bs-border-color-translucent));
}

.view-mode-both .preview-pane {
    border-right: none;
}

.markdown-textarea {
    flex: 1 1 auto;
    /* Fill the edit pane. A <textarea> doesn't reliably grow via flex alone (it falls back to its
       intrinsic rows-based height, ~50% here), so pin height:100% + min-height:0; border-box keeps the
       padding inside the 100%. */
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    border: none;
    outline: none;
    padding: 0.6rem 0.75rem;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    color: inherit;
    background: transparent;
}

    .markdown-textarea::placeholder {
        color: #9ca3af;
        font-style: italic;
    }

/* GitHub Markdown Body Container */
.preview-content {
    padding: 0.6rem 0.75rem;
    overflow-y: auto;
    flex: 1;
}

.markdown-body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: none;
    margin: 0;
}

    /* Enhanced GitHub Markdown Table Styles */
    .markdown-body table {
        border-spacing: 0;
        border-collapse: collapse;
        /* display:table (not block) so thead and tbody share ONE column layout. With display:block a
           table generates anonymous table wrappers, and inside a DevExpress grid cell the browser split
           the header and body into separate column grids — the narrow header row (sized to "A"/"B") then
           detached above the wider body (sized to "One"/"Three"). display:table forces a single table
           formatting context, so the columns stay aligned in every render context. */
        display: table;
        width: max-content;
        max-width: 100%;
        overflow: hidden; /* clip children to the rounded corners (was 'auto' for block-table scroll) */
        margin: 16px 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        border: 1px solid #d0d7de;
    }

        .markdown-body table tr {
            /*background-color: #ffffff;*/
            border-top: 1px solid #d0d7de;
        }

            .markdown-body table tr:nth-child(2n) {
                background-color: #f6f8fa;
            }

            .markdown-body table tr:hover {
                background-color: #eef3fd;
                transition: background-color 0.15s ease;
            }

        .markdown-body table th,
        .markdown-body table td {
            padding: 12px 16px;
            border: 1px solid #d0d7de;
            text-align: left;
            vertical-align: middle;
            position: relative;
        }

        .markdown-body table th {
            font-weight: 600;
            font-size: 14px;
            letter-spacing: 0.025em;
            border-bottom: 2px solid #d0d7de;
        }

            .markdown-body table th:first-child {
                border-top-left-radius: 7px;
            }

            .markdown-body table th:last-child {
                border-top-right-radius: 7px;
            }

        .markdown-body table tbody tr:last-child td:first-child {
            border-bottom-left-radius: 7px;
        }

        .markdown-body table tbody tr:last-child td:last-child {
            border-bottom-right-radius: 7px;
        }

        .markdown-body table td {
            font-size: 14px;
            line-height: 1.5;
        }

        /* Remove border from first row if it's the header */
        .markdown-body table tr:first-child {
            border-top: none;
        }

        /* Better alignment options */
        .markdown-body table th[align="center"],
        .markdown-body table td[align="center"] {
            text-align: center;
        }

        .markdown-body table th[align="right"],
        .markdown-body table td[align="right"] {
            text-align: right;
        }

        .markdown-body table thead tr {
            background-color: var(--dxds-utility-gray-20, var(--bs-gray-300)) !important;
            color: black;
            border-top: 1px solid #d0d7de;
        }

        /* Optional: Add subtle borders for better cell definition */
        .markdown-body table.bordered th,
        .markdown-body table.bordered td {
            border-right: 1px solid var(--color-border-default, #e1e8ed);
        }

            .markdown-body table.bordered th:last-child,
            .markdown-body table.bordered td:last-child {
                border-right: 1px solid var(--color-border-default, #d0d7de);
            }

        /* Optional: Compact table variant */
        .markdown-body table.compact th,
        .markdown-body table.compact td {
            padding: 6px 12px;
            font-size: 13px;
        }

        /* Optional: Minimal table variant with less visual weight */
        .markdown-body table.minimal {
            box-shadow: none;
            border: none;
            border-radius: 0;
        }

            .markdown-body table.minimal th,
            .markdown-body table.minimal td {
                border: none;
                border-bottom: 1px solid #e1e8ed;
            }

            .markdown-body table.minimal th {
                border-bottom: 2px solid #d0d7de;
                background-color: transparent;
            }

            .markdown-body table.minimal tr:hover {
                background-color: #f8f9fa;
            }

    /* Dark body background at 85% opacity (github-markdown-dark sets an opaque #0d1117).
       Uses an rgba background-color, not `opacity`, so the text stays fully opaque. */
    .markdown-body.markdown-dark {
        background-color: rgba(13, 17, 23, 0.85);
    }

        /* Dark theme table overrides (matches github-markdown-dark 5.4.0 palette).
       The light colors above are hardcoded and would otherwise leave the
       dark-theme text (light) on a light background. */
        .markdown-body.markdown-dark table {
            border-color: #30363d;
        }

            .markdown-body.markdown-dark table tr {
                background-color: #0d1117;
                border-top-color: #21262d;
            }

                .markdown-body.markdown-dark table tr:nth-child(2n) {
                    background-color: #161b22;
                }

                .markdown-body.markdown-dark table tr:hover {
                    background-color: #21262d;
                }

            .markdown-body.markdown-dark table th,
            .markdown-body.markdown-dark table td {
                border-color: #30363d;
            }

            .markdown-body.markdown-dark table th {
                border-bottom-color: #30363d;
            }

            .markdown-body.markdown-dark table thead tr {
                background-color: #161b22 !important;
                color: #e6edf3;
                border-top-color: #30363d;
            }

    /* Custom GitHub Alert Styles - accent bar + translucent accent-tinted background for more impact.
       Backgrounds are low-alpha rgba of each type's accent, so they read correctly over light OR dark
       theme backgrounds without needing separate dark-mode overrides. */
    .markdown-body .markdown-alert {
        padding: 5px 10px 10px 16px !important;
        margin: 16px 0;
        border-left: 4px solid;
        border-radius: 6px;
    }

    .markdown-body .markdown-alert-note {
        border-left-color: #0969da;
        background-color: rgba(9, 105, 218, 0.1);
    }

.markdown-alert-note > .markdown-alert-title,
.markdown-alert-note > p.markdown-alert-title {
    color: #0969da;
}

p.markdown-alert-title {
    margin-bottom: 4px !important;
}

.markdown-body .markdown-alert-tip {
    border-left-color: #1a7f37;
    background-color: rgba(26, 127, 55, 0.1);
}

.markdown-alert-tip > .markdown-alert-title,
.markdown-alert-tip > p.markdown-alert-title {
    color: #1a7f37;
}

.markdown-body .markdown-alert-important {
    border-left-color: #9a6700;
    background-color: rgba(154, 103, 0, 0.1);
}

.markdown-alert-important > .markdown-alert-title,
.markdown-alert-important > p.markdown-alert-title {
    color: #9a6700;
}

.markdown-body .markdown-alert-warning {
    border-left-color: #bc4c00;
    background-color: rgba(188, 76, 0, 0.1);
}

.markdown-alert-warning > .markdown-alert-title,
.markdown-alert-warning > p.markdown-alert-title {
    color: #bc4c00;
}

.markdown-body .markdown-alert-caution {
    border-left-color: #d1242f;
    background-color: rgba(209, 36, 47, 0.1);
}

.markdown-alert-caution > .markdown-alert-title,
.markdown-alert-caution > p.markdown-alert-title {
    color: #d1242f;
}

/* Alert title styling for both div and p tags */
.markdown-body .markdown-alert-title,
.markdown-body p.markdown-alert-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    margin-top: 0;
}

    .markdown-body .markdown-alert-title svg,
    .markdown-body p.markdown-alert-title svg {
        margin-right: 8px;
        flex-shrink: 0;
        width: 16px;
        height: 16px;
    }

/* Dark mode support for overlay */
@media (prefers-color-scheme: dark) {
    .view-mode-toggle {
        background: transparent !important; /* stay flat in dark mode too */
        border: none !important;
    }
}

/* Enhanced responsive behavior */
@media (max-width: 768px) {
    .markdown-body table {
        font-size: 13px;
    }

        .markdown-body table th,
        .markdown-body table td {
            padding: 8px 12px;
        }

    .view-mode-both .editor-content {
        flex-direction: column;
    }

    .view-mode-both .editor-pane,
    .view-mode-both .preview-pane {
        border-right: none;
        border-bottom: 1px solid #e1e8ed;
    }

    .view-mode-both .preview-pane {
        border-bottom: none;
    }

    .view-mode-toggle {
        transform: scale(0.9);
    }

    .markdown-textarea,
    .preview-content {
        padding-top: 0.6rem;
    }
}
