body {
    font-family: 'Courier New', monospace;
    background-color: #f4f4f4;
    color: #222;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border: 2px solid black;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.section-desc {
    font-style: italic;
    margin-bottom: 1rem;
    text-align: justify;
}

.link-section {
    padding: 1.5rem;
    background-color: #eee !important;
    border-left: 4px solid #888;
}

.link-item {
    padding: 1rem;
    background-color: white;
    border: 1px solid #ccc;
    transition: all 0.3s ease;
    padding: 0 !important;
}

    .link-item:hover {
        transform: translateX(5px);
        box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    }

.link-item-large {
    height: 110px;
}

.link-item-important {
    background-color: #FFF8E1 !important;
}

.case-file {
    width: 100%;
}

.case-left {
    font-weight: bold !important;
    text-align: left;
}

.case-right {
    text-align: right;
    color: #666;
}

.case-field {
    background-color: #eee;
    border-bottom: 1px solid black;
    padding: 0.5rem;
}

.footer {
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid #ccc;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

.redacted {
    background-color: #000;
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
    display: inline-block;
    user-select: none;
}

.mud-typography {
    font-family: 'Courier New', monospace;
}

.mud-paper {
    border-radius: 0 !important;
}

.mud-card {
    border-radius: 0;
}

.mud-card-content {
    padding: 1rem;
}

.mud-button {
    border-radius: 0;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

.top-nav {
    background-color: #673AB7;
    padding: 12px 24px;
    border-radius: 0 !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.nav-links {
    font-size: 1.25rem;
    font-weight: 500;
}

.nav-item {
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
    padding: 8px 16px;
    border-radius: 4px;
}

.mud-nav-item {
    height: 100% !important;
}

.nav-item-override {
    height: auto !important;
}

.mud-nav-link {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100% !important;
}

.mud-nav-link-text {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.mud-nav-link .mud-nav-link-text {
    margin-left: 0px !important;
    margin-inline-start: 0px !important;
}

.nav-item .mud-nav-link .mud-nav-link-text {
    text-align: center !important;
}

.nav-item:hover,
.nav-item:focus,
.nav-item.mud-nav-link:hover {
    background-color: transparent !important;
    box-shadow: none !important;
}

.nav-item .mud-nav-link:hover {
    background-color: transparent !important;
}

.mud-card a:hover {
    background-color: transparent !important;
    text-decoration: none;
    color: inherit;
}

.mud-card .mud-nav-link {
    padding: 0 !important;
}

.active-nav {
    font-weight: bold !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.mud-nav-link:focus:not(.mud-nav-link-disabled) {
    background-color: transparent !important;
    border-radius: 20px !important;
    outline: none;
}

.equal-width-nav > .nav-item {
    flex: 1;
    text-align: center;
    min-width: 0; /* prevents overflow */
    padding: 0.5rem 1rem;
}

/* ===== Masthead (wordmark above horizontal nav) ===== */
.bar-masthead-container {
    padding-top: 1.5rem;
}

.bar-masthead {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar-brand {
    display: block;
    width: 100%;
}

.bar-brand img {
    display: block;
    width: 100%;
    height: auto;
}

/* ----- horizontal nav links ----- */
.bar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.75rem;
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: 1px solid #d6d3c9;
}

.bar-nav-link {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #3a3a3a;
    text-decoration: none;
    padding: 0.4rem 0.25rem;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.bar-nav-link:hover {
    color: #111;
    border-bottom-color: #b5b2a8;
}

.bar-nav-link.bar-nav-link-active {
    color: #111;
    font-weight: 700;
    border-bottom-color: #3a3a3a;
}

.subtitle {
    font-weight: 500 !important;
    font-style: italic;
}

.grey-background {
    background-color: #eee;
}

.bolded {
    font-weight: bold !important;
}

.italicized {
    font-style: italic !important;
}

.virtualized-card {
    margin-bottom: 1rem;
}

    .virtualized-card:last-of-type {
        margin-bottom: 0 !important;
    }

th {
    font-weight: bold !important;
    background-color: #333 !important;
    color: white !important;
}

td {
    min-width: 80px;
}

.td-wide {
    min-width: 100px !important;
}

.td-max-width-small {
    width: 80px !important;
}

.attachment-item {
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .attachment-item:hover {
        transform: translateX(5px);
        box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    }

.mud-dialog-content {
    padding: 0 !important;
    margin: 0 !important;
}

.link-section .mud-typography-body1 {
    text-align: justify !important;
}

/* Reference document body, rendered from Markdown by MarkdownDocParser:
 * - Headings come out as separate MudText fragments (centered, uppercase).
 * - Prose chunks live inside MudPaper.link-section.reference-doc-prose.
 * - Canon tables render inside a MudTable; we add spacing below so the next
 *   heading does not collide with the table border. */
.reference-doc-prose {
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    text-align: justify;
}

    .reference-doc-prose > *:first-child {
        margin-top: 0;
    }

    .reference-doc-prose > *:last-child {
        margin-bottom: 0;
    }

    .reference-doc-prose p {
        margin: 0 0 0.75rem 0;
    }

        .reference-doc-prose p:last-child {
            margin-bottom: 0;
        }

    .reference-doc-prose ul,
    .reference-doc-prose ol {
        margin: 0.25rem 0 1rem 0;
        padding-left: 2rem;
    }

        .reference-doc-prose ul li,
        .reference-doc-prose ol li {
            margin-bottom: 0.25rem;
        }

    .reference-doc-prose code {
        font-family: 'Courier New', monospace;
        background-color: #ddd;
        padding: 0 4px;
        border-radius: 2px;
    }

    .reference-doc-prose a {
        color: #1a4d8c;
        text-decoration: underline;
    }

    /* Plain Markdown pipe tables (e.g. the Anomalous Symptoms Repository) render as
     * inline HTML inside the prose paper. Canon-driven tables use MudTable instead;
     * this styling only targets the bespoke prose tables so they read as data, not
     * as run-together text. */
    .reference-doc-prose table {
        width: 100%;
        border-collapse: collapse;
        margin: 0.5rem 0 1rem 0;
        font-size: 0.85rem;
        text-align: left;
    }

        .reference-doc-prose table th,
        .reference-doc-prose table td {
            border: 1px solid #000;
            padding: 4px 8px;
            vertical-align: top;
        }

        .reference-doc-prose table th {
            background-color: #000;
            color: #fff;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .reference-doc-prose table tbody tr:nth-child(even) {
            background-color: #f0f0f0;
        }

/* Bare headings between sections (rendered by ReferenceDocument.razor as MudText). */
.reference-doc-heading {
    letter-spacing: 0.04em;
}

/* Every canon-driven MudTable on a reference doc page needs a margin-bottom so
 * the next section heading does not sit flush against the table border. */
.mud-container .mud-table {
    margin-bottom: 1.5rem;
}

/* Right-side reference-id box on each reference-document card. Stacks three rows
 * (document-type code / domain number / doc id) on a black background, mirroring
 * the YY-XXX-ZZ identifier format established in SYS-000-01. */
.reference-doc-ref-box {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 100%;
    background-color: black;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.04em;
    user-select: none;
}

.reference-doc-ref-row {
    font-size: 0.95rem;
    line-height: 1.2;
}

.reference-doc-ref-type {
    font-weight: 700;
}

.reference-doc-ref-sep {
    width: 60%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.35);
    margin: 0.15rem 0;
}

.warning {
    background-color: #8B0000 !important;
    color: white !important;
}

.wip-overlay {
    background-color: #E0E0E0 !important;
    color: #A0A0A0 !important;
    border: 1px dashed #B0B0B0 !important;
}

.centered-text {
    text-align: center !important;
}

.blur-effect {
    filter: blur(10px);
}

.case-section {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.5;
}

    .case-section p {
        text-align: justify;
        margin: 0 0 1rem 0;
    }

        .case-section p:last-child {
            margin-bottom: 0;
        }

    .case-section ul,
    .case-section ol {
        margin: 0 0 1rem 0;
        padding-left: 2rem;
        text-align: justify;
    }

        .case-section ul li,
        .case-section ol li {
            margin-bottom: 0.25rem;
        }

    .case-section blockquote {
        margin: 1rem 0;
        padding: 0.75rem 1rem;
        border-left: 4px solid #555;
        background-color: #e3e3e3;
        font-style: italic;
        white-space: pre-wrap;
    }

        .case-section blockquote p {
            margin-bottom: 0.5rem;
        }

            .case-section blockquote p:last-child {
                margin-bottom: 0;
            }

    .case-section h1,
    .case-section h2,
    .case-section h3,
    .case-section h4,
    .case-section h5,
    .case-section h6 {
        font-family: 'Courier New', monospace;
        font-weight: bold;
        margin: 1rem 0 0.5rem 0;
    }

    .case-section code {
        font-family: 'Courier New', monospace;
        background-color: #ddd;
        padding: 0 4px;
        border-radius: 2px;
    }

    .case-section a {
        color: #1a4d8c;
        text-decoration: underline;
    }

    .case-section hr {
        border: none;
        border-top: 1px solid #aaa;
        margin: 1rem 0;
    }

/* Reference document card body offset. The right-side ref-id box is
 * absolutely positioned at 80px wide; the card content needs the same
 * margin-right so text doesn't slide under it. Pulled out of inline
 * styles so the @media block below can shrink it on small screens. */
.reference-doc-card-body {
    margin-right: 80px;
}

/* Mobile (< sm) layout adjustments. Pages keep their dossier-style
 * border but lose most of the inner padding so the content column
 * isn't crushed to ~250px on a 360px viewport. Tightens up nav padding,
 * scales down the stacked H3/H4/H5 page titles, and shrinks the
 * reference-doc right-id box / card height so long titles can breathe. */
@media (max-width: 599.98px) {
    .container {
        padding: 0.75rem;
    }

    .top-nav {
        padding: 8px 12px;
    }

    .nav-links {
        font-size: 1rem;
    }

    .reference-doc-ref-box {
        width: 60px;
    }

    .reference-doc-card-body {
        margin-right: 60px;
    }

    .link-item-large {
        height: auto;
        min-height: 110px;
    }

    .reference-doc-prose,
    .case-section {
        line-height: 1.5;
    }

    .mud-typography-h3 {
        font-size: 1.4rem !important;
    }

    .mud-typography-h4 {
        font-size: 1.2rem !important;
    }

    .mud-typography-h5 {
        font-size: 1.05rem !important;
    }
}

/* ==========================================================================
   CASE-STYLE: MOTLEY
   Per-case custom styling for freeform "circuit-breaker" documents.
   Activated via Custom Style: motley in the case header.
   ========================================================================== */

.case-style-motley .link-section {
    border-left: 4px solid #9c27b0;
    background-color: #faf5ff !important;
}

.case-style-motley .case-section p {
    text-align: center;
    margin: 0.75rem 0;
}

.case-style-motley .case-section ul {
    text-align: left;
    display: inline-block;
}

.case-style-motley .case-field {
    background-color: #f3e5f5;
    border-bottom-color: #9c27b0;
    font-style: italic;
}

.case-style-motley .mud-typography-h5 {
    color: #6a1b9a;
}

.case-style-motley .case-section blockquote {
    border-left-color: #ce93d8;
    background-color: #f3e5f5;
}
