html, body {
    height: 100%;
}

app {
    display: block;
    height: 100%;
}

.header-logo {
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url('../images/Logo.svg');
    mask: url('../images/Logo.svg');
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    width: 28px;
    height: 24px;
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}
/* ═══════════════════════════════════════════════════════════════════════
   Markdown Editor (MarkdownEditorComponent)
   Global styles — scoped CSS unreliable inside XAF property editors
   ═══════════════════════════════════════════════════════════════════════ */
.md-editor-host {
    display: block;
    width: 100%;
    /* Fixed height — do NOT use flex here; DX tab wrappers break flex height propagation */
    height: var(--md-editor-height, 440px);
    overflow: hidden;
}

/* Don't fight DX's internal tab structure — just cap the content wrappers */
.md-editor-host .dxbl-tabs,
.md-editor-host .dxbl-tabs-content,
.md-editor-host .dxbl-tab-pane {
    overflow: hidden;
}

/* Tab bar height is ~42px — subtract it so content panels never overflow the host */
.md-raw {
    display: block;
    width: 100%;
    height: calc(var(--md-editor-height, 440px) - 42px);
    resize: none;
    font-family: 'Consolas', 'Fira Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 10px 12px;
    border: 1px solid var(--dx-color-border, #ccc);
    background: var(--dx-color-editor-background, #fff);
    color: var(--dx-color-text, #333);
    border-radius: 4px;
    outline: none;
    tab-size: 4;
    box-sizing: border-box;
    overflow-y: auto;
}

.md-raw:focus {
    border-color: var(--dx-color-primary, #337ab7);
    box-shadow: 0 0 0 2px rgba(51,122,183,0.2);
}

.md-raw[readonly] {
    background: var(--dx-color-editor-background-disabled, #f5f5f5);
    color: var(--dx-color-text-muted, #666);
    cursor: default;
}

.md-preview {
    padding: 16px 20px;
    /* Same calc as .md-raw — explicit height, never grows with content */
    height: calc(var(--md-editor-height, 440px) - 42px);
    font-size: 14px;
    line-height: 1.7;
    color: var(--dx-color-text, #333);
    overflow-y: auto;
    box-sizing: border-box;
}

.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4 {
    border-bottom: 1px solid var(--dx-color-border, #e0e0e0);
    padding-bottom: 4px;
    margin-top: 24px;
    margin-bottom: 8px;
    font-weight: 600;
}
.md-preview h1 { font-size: 1.6em; }
.md-preview h2 { font-size: 1.35em; }
.md-preview h3 { font-size: 1.15em; }
.md-preview p  { margin: 8px 0; }

.md-preview a { color: var(--dx-color-primary, #337ab7); text-decoration: none; }
.md-preview a:hover { text-decoration: underline; }

.md-preview code {
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    color: #c7254e;
}

.md-preview pre {
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    padding: 12px 16px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 12px 0;
}
.md-preview pre code { background: none; border: none; padding: 0; color: #333; }

.md-preview blockquote {
    border-left: 3px solid #ccc;
    margin: 12px 0;
    padding: 4px 0 4px 16px;
    color: #888;
    font-style: italic;
}

.md-preview ul, .md-preview ol { padding-left: 24px; margin: 8px 0; }
.md-preview li { margin: 4px 0; }

.md-preview table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.md-preview th, .md-preview td { border: 1px solid #ddd; padding: 6px 10px; }
.md-preview th { background: #f5f5f5; font-weight: 600; }
.md-preview tr:nth-child(even) td { background: #fafafa; }

.md-preview hr { border: none; border-top: 1px solid #e0e0e0; margin: 20px 0; }
.md-empty { color: #aaa; font-style: italic; }
