.cas-rich {
    overflow-wrap: anywhere;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
}
.cas-rich-block {
    line-height: 1.55;
}
.cas-rich-block > :first-child {
    margin-top: 0;
}
.cas-rich-block > :last-child {
    margin-bottom: 0;
}
.cas-rich :is(h2, h3, h4) {
    font-weight: 650;
    line-height: 1.25;
    margin: 1em 0 0.4em;
}
.cas-rich h2 {
    font-size: 1.45em;
}
.cas-rich h3 {
    font-size: 1.25em;
}
.cas-rich h4 {
    font-size: 1.1em;
}
.cas-rich blockquote {
    padding: 0.3rem 0.8rem;
    margin: 0.6em 0;
    border-inline-start: 0.2rem solid var(--cobtah-accent, #327378);
}
.cas-rich mark {
    color: #302616;
    background: #ffebb0;
}
.cas-rich pre {
    overflow-x: auto;
    white-space: pre-wrap;
    background: var(--cobtah-surface-secondary, #f2f0ed);
    padding: 0.6rem;
}
.cas-rich table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin-block: 0.7em;
}
.cas-rich :is(td, th) {
    border: 1px solid var(--cobtah-border, #a8a8a8);
    padding: 0.35em 0.55em;
    vertical-align: top;
}
.cas-rich-inline {
    font: inherit;
}
.cas-rich-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    margin-bottom: 0.75rem;
}
.cas-rich-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 0.3rem;
    margin-block: 0.2rem 0.65rem;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    text-align: start;
}
.cas-rich-editor [hidden] {
    display: none !important;
}
.cas-rich-modes,
.cas-rich-tools,
.cas-rich-link {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-block: 0.3rem;
}
.cas-rich-editor button {
    color: var(--cobtah-text, #273338);
    background: var(--cobtah-surface, #fff);
    border: 1px solid var(--cobtah-border, #aaa);
    border-radius: 0.35rem;
    padding: 0.25rem 0.55rem;
    min-height: 2rem;
}
.cas-rich-editor button:focus-visible,
.cas-rich-editor [contenteditable]:focus-visible {
    outline: 2px solid var(--cobtah-accent, #327378);
    outline-offset: 2px;
}
.cas-rich-modes [aria-pressed="true"] {
    font-weight: 700;
    border-color: currentColor;
}
.cas-rich-editor :is(.ql-container, .cas-rich-source, .cas-rich-block, .cas-rich-inline) {
    display: block;
    height: auto;
    font: inherit;
    min-height: 5rem;
    width: 100%;
    overflow-wrap: anywhere;
}
.cas-rich-editor .ql-editor {
    height: auto;
    white-space: pre-wrap;
    min-height: 5rem;
    font: inherit;
}
.cas-rich-editor .cas-rich-source {
    font-family: ui-monospace, monospace;
}
.cas-rich-editor small:not(:empty) {
    display: block;
    margin-top: 0.35rem;
}
@media print {
    .cas-rich-editor :is(.cas-rich-modes, .cas-rich-tools, .cas-rich-link, small) {
        display: none;
    }
    .cas-rich {
        color: #111;
    }
    .cas-rich pre {
        overflow: visible;
    }
    .cas-rich tr {
        break-inside: avoid;
    }
}

:is(.dim-project-card, [data-program-kind]) .cas-rich-inline {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}
@media print {
    :is(.dim-project-card, [data-program-kind]) .cas-rich-inline {
        display: inline;
        overflow: visible;
    }
}

.cas-rich-tools [data-format="bold"] {
    font-weight: 700;
}
.cas-rich-tools [data-format="italic"] {
    font-style: italic;
}
.cas-rich-tools [data-format="strike"] {
    text-decoration: line-through;
}
.cas-rich-tools [data-format="underline"] {
    text-decoration: underline;
}

.cas-rich-editor .cas-rich-hint {
    color: var(--cobtah-muted, #49565a);
    margin: 0;
}
.cas-rich-editor [aria-invalid="true"] {
    outline: 2px solid #a52525;
}
.cas-rich-editor small[aria-live]:not(:empty),
.cas-rich-errors {
    font-weight: 600;
}
.cas-rich-errors:not([hidden]) {
    border-inline-start: 3px solid #a52525;
    padding: 0.6rem 0.9rem;
    margin-block: 0.5rem;
}
.cas-rich-errors button {
    color: inherit;
    background: transparent;
    border: 0;
    text-decoration: underline;
    text-align: start;
}
.cas-rich-field > [data-valmsg-for]:empty {
    display: none;
}
