/* ── Error dialog ──
   Global (not scoped) because Syncfusion's modal SfDialog renders outside the component tree.
   Colours come from the Tier-2 --notification-* tokens so the dialog tracks the active theme
   instead of carrying a second hardcoded palette; the neutral greys use the Syncfusion theme's
   own --color-sf-* tokens for the same reason. */

.error-dialog.e-dialog {
    border: 2px solid var(--notification-error-accent, #c62828);
}

.error-dialog .e-dlg-header-content {
    color: var(--notification-error-accent, #c62828);
}

/* Syncfusion truncates the title by default; a batched heading and a long single-error title
   both need to wrap. */
.error-dialog .e-dlg-header {
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    overflow-wrap: break-word;
}

.error-dialog-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.error-dialog-icon.mdi {
    font-size: 2.25rem;
    line-height: 1;
}

/* Capped and scrollable: a burst of errors must not grow the modal past the viewport. */
.error-dialog-content {
    font-size: 0.875rem;
    line-height: 1.5;
    max-height: min(60vh, 32rem);
    overflow-y: auto;
}

/* Separates the entries when a burst of errors is batched into one dialog. A single error gets
   no rule, so the common case is unchanged. */
.error-dialog-entry + .error-dialog-entry {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-sf-border, #e5e7eb);
}

.error-dialog-message {
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.error-dialog-count {
    margin-left: 0.375rem;
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.75;
}

.error-dialog-pending {
    margin: 1rem 0 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-sf-border, #e5e7eb);
    font-size: 0.8rem;
    opacity: 0.85;
}

.error-dialog-validation {
    margin: 0.25rem 0 0.75rem 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--notification-error-accent, #c62828);
}

.error-dialog-validation li {
    margin-bottom: 0.25rem;
}

.error-dialog-details {
    margin-top: 0.75rem;
    border-top: 1px solid var(--color-sf-border, #e5e7eb);
    padding-top: 0.5rem;
}

.error-dialog-details summary {
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    user-select: none;
}

.error-dialog-details summary:hover,
.error-dialog-details summary:focus-visible {
    opacity: 1;
}

.error-dialog-details-body {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.error-dialog-details-body p {
    margin: 0.25rem 0;
    word-break: break-word;
}

.error-dialog-details-body code,
.error-dialog-stacktrace {
    font-family: var(--tv-font-mono, monospace);
    background: var(--color-sf-table-bg-color-hover, rgba(127, 127, 127, 0.12));
    border-radius: 3px;
}

.error-dialog-details-body code {
    font-size: 0.75rem;
    padding: 0.1rem 0.35rem;
}

.error-dialog-stacktrace {
    font-size: 0.7rem;
    max-height: 200px;
    overflow: auto;
    padding: 0.5rem;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0.25rem 0 0 0;
    border: 1px solid var(--color-sf-border, #e5e7eb);
}
