/* Prevent text selection on all UI elements except inputs */
* {
    -webkit-user-select: none;
    user-select: none;
}

/* Restore for inputs and textareas */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

/* Pointer cursor for all interactive elements and their children */
a, a *,
button, button *,
[role="button"], [role="button"] *,
label[for], label[for] *,
summary, summary *,
.cursor-pointer, .cursor-pointer * {
    cursor: pointer !important;
}

/* Grab cursor for draggable items (exclude interactive elements inside) */
[draggable="true"], [draggable="true"] *:not(button):not(button *):not(a):not(a *):not(input):not(textarea):not(select) {
    cursor: grab !important;
}
[draggable="true"]:active, [draggable="true"]:active *:not(button):not(button *):not(a):not(a *):not(input):not(textarea):not(select) {
    cursor: grabbing !important;
}

/* Text cursor for inputs */
input, textarea, [contenteditable="true"] {
    cursor: text !important;
}

/* High-quality image downscaling */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
}

/* Rendered markdown prose */
.markdown-body {
    -webkit-user-select: text;
    user-select: text;
    line-height: 1.7;
}
.markdown-body h1 { font-size: 1.5rem; font-weight: 700; margin: 1.25rem 0 0.5rem; color: #1e293b; }
.markdown-body h2 { font-size: 1.25rem; font-weight: 600; margin: 1rem 0 0.5rem; color: #1e293b; }
.markdown-body h3 { font-size: 1.1rem; font-weight: 600; margin: 0.75rem 0 0.25rem; color: #334155; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1rem; font-weight: 600; margin: 0.5rem 0 0.25rem; color: #334155; }
.markdown-body p { margin: 0.5rem 0; }
.markdown-body ul, .markdown-body ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.markdown-body ul { list-style-type: disc; }
.markdown-body ol { list-style-type: decimal; }
.markdown-body li { margin: 0.15rem 0; }
.markdown-body strong { font-weight: 600; }
.markdown-body em { font-style: italic; }
.markdown-body code { font-size: 0.85em; background: #f1f5f9; padding: 0.15rem 0.35rem; border-radius: 0.25rem; font-family: ui-monospace, monospace; }
.markdown-body pre { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.75rem 1rem; overflow-x: auto; margin: 0.5rem 0; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 3px solid #cbd5e1; padding-left: 1rem; color: #64748b; margin: 0.5rem 0; }
.markdown-body hr { border: none; border-top: 1px solid #e2e8f0; margin: 1rem 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.875rem; }
.markdown-body th { text-align: left; font-weight: 600; padding: 0.5rem; border-bottom: 2px solid #e2e8f0; color: #475569; }
.markdown-body td { padding: 0.5rem; border-bottom: 1px solid #f1f5f9; }
.markdown-body tr:hover td { background: #f8fafc; }
.markdown-body a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.markdown-body img { max-width: 100%; border-radius: 0.5rem; }

/* Blazor error UI */
#blazor-error-ui {
    display: none;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 0.5rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
