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AyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* ─── Design-System Utility Classes ─── */

/* Icon box containers — grey background, centered icon */
.icon-box-sm {
    background: var(--mud-palette-gray-lighter);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box-md {
    background: var(--mud-palette-gray-lighter);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box-lg {
    background: var(--mud-palette-gray-lighter);
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

/* Pill badge — grey rounded chip */
.pill {
    background: var(--mud-palette-gray-lighter);
    padding: 2px 10px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.pill-sm {
    background: var(--mud-palette-gray-lighter);
    padding: 1px 8px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
}

/* Subtle border (MudBlazor doesn't have a border utility) */
.border-subtle {
    border: 1px solid var(--mud-palette-divider);
}

.border-top-subtle {
    border-top: 1px solid var(--mud-palette-divider);
}

.border-bottom-subtle {
    border-bottom: 1px solid var(--mud-palette-divider);
}

.border-right-subtle {
    border-right: 1px solid var(--mud-palette-divider);
}

/* 12px radius (MudBlazor has rounded-lg=8px, rounded-xl=16px, but no 12px) */
.rounded-md {
    border-radius: 12px;
}

/* Dialog footer pattern */
.dialog-footer {
    width: 100%;
    padding: 16px 24px;
    border-top: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Two-column grid for form fields */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ─── StandardDialog responsive content widths ─── */

/* xs: phone (<600px) — 5% total margin */
.std-dialog-content {
    margin: 0 auto;
    padding: 0 12px;
    width: 95%;
}

.std-dialog-actions {
    width: 100%;
    padding: 12px 16px;
    border-top: 1px solid #F0F0F0;
    background: white;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* sm: tablet (600px+) — 10% total margin */
@media (min-width: 600px) {
    .std-dialog-content {
        padding: 0 16px;
        width: 90%;
    }

    .std-dialog-actions {
        padding: 16px 24px;
    }
}

/* md: small laptop (960px+) — 15% total margin */
@media (min-width: 960px) {
    .std-dialog-content {
        padding: 0 24px;
        width: 85%;
        max-width: 1200px;
    }
}

/* lg: desktop (1280px+) — 20% total margin */
@media (min-width: 1280px) {
    .std-dialog-content {
        width: 80%;
        max-width: 1400px;
    }
}

/* xl: large monitor (1920px+) — 30% total margin */
@media (min-width: 1920px) {
    .std-dialog-content {
        width: 70%;
        max-width: 1600px;
    }
}

/* xxl: TV / ultra-wide (2560px+) — 40% total margin */
@media (min-width: 2560px) {
    .std-dialog-content {
        width: 60%;
        max-width: 1800px;
    }
}

/* ─── Reconnect modal ─── */

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}

#components-reconnect-modal {
    background-color: white;
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity 0.5s both;
}

#components-reconnect-modal[open] {
    animation: components-reconnect-modal-slideUp 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s,
               components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s;
    animation-fill-mode: both;
}

#components-reconnect-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
    opacity: 1;
}

@keyframes components-reconnect-modal-slideUp {
    0% { transform: translateY(30px) scale(0.95); }
    100% { transform: translateY(0); }
}

@keyframes components-reconnect-modal-fadeInOpacity {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes components-reconnect-modal-fadeOutOpacity {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.components-reconnect-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p {
    margin: 0;
    text-align: center;
}

#components-reconnect-modal button {
    border: 0;
    background-color: #6b9ed2;
    color: white;
    padding: 4px 24px;
    border-radius: 4px;
}

#components-reconnect-modal button:hover {
    background-color: #3b6ea2;
}

#components-reconnect-modal button:active {
    background-color: #6b9ed2;
}

.components-rejoining-animation {
    position: relative;
    width: 80px;
    height: 80px;
}

.components-rejoining-animation div {
    position: absolute;
    border: 3px solid #0087ff;
    opacity: 1;
    border-radius: 50%;
    animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.components-rejoining-animation div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes components-rejoining-animation {
    0% { top: 40px; left: 40px; width: 0; height: 0; opacity: 0; }
    4.9% { top: 40px; left: 40px; width: 0; height: 0; opacity: 0; }
    5% { top: 40px; left: 40px; width: 0; height: 0; opacity: 1; }
    100% { top: 0; left: 0; width: 80px; height: 80px; opacity: 0; }
}


/* ─── Dojo Chat markdown rendering ─── */

.dojo-chat-markdown h1,
.dojo-chat-markdown h2,
.dojo-chat-markdown h3 {
    color: #1A1E21;
    font-weight: 600;
    margin: 12px 0 6px 0;
    line-height: 1.3;
}

.dojo-chat-markdown h1 { font-size: 1.1rem; }
.dojo-chat-markdown h2 { font-size: 1rem; }
.dojo-chat-markdown h3 { font-size: 0.9rem; }

.dojo-chat-markdown h1:first-child,
.dojo-chat-markdown h2:first-child,
.dojo-chat-markdown h3:first-child {
    margin-top: 0;
}

.dojo-chat-markdown p {
    color: #4A5568;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.dojo-chat-markdown p:last-child {
    margin-bottom: 0;
}

.dojo-chat-markdown strong {
    color: #1A1E21;
    font-weight: 600;
}

.dojo-chat-markdown ul,
.dojo-chat-markdown ol {
    color: #4A5568;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 4px 0 8px 0;
    padding-left: 20px;
}

.dojo-chat-markdown li {
    margin-bottom: 4px;
}

.dojo-chat-markdown li:last-child {
    margin-bottom: 0;
}

.dojo-chat-markdown code {
    background: #F5F5F5;
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Suppress browser native context menu on operations tree rows */
.dojo-tree-no-contextmenu {
    -webkit-touch-callout: none;
    user-select: none;
}

.dojo-tree-no-contextmenu * {
    pointer-events: auto;
}

/* Operations page — hover lift effect */
.ops-hover-lift { transition: transform 0.2s, box-shadow 0.2s; }
.ops-hover-lift:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.05) !important; }

/* InternalEventUpload — drag-and-drop zone states */
.ieu-drop-zone {
    border: 2px dashed var(--mud-palette-text-disabled);
    border-radius: 12px;
    position: relative;
    transition: all 0.2s ease;
    background: var(--mud-palette-surface);
}

.ieu-drop-zone:hover {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-primary-lighten);
}

.ieu-drop-zone-active {
    border: 2px dashed var(--mud-palette-primary);
    border-radius: 12px;
    position: relative;
    background: var(--mud-palette-primary-lighten);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.ieu-drop-zone-uploading {
    border: 2px solid var(--mud-palette-primary);
    border-radius: 12px;
    position: relative;
    background: var(--mud-palette-primary-lighten);
}

.ieu-drop-zone-complete {
    border: 2px solid var(--mud-palette-success);
    border-radius: 12px;
    position: relative;
    background: #E8F5E9;
    animation: ieu-pulse 0.5s ease;
}

@keyframes ieu-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* AI Commentary markdown rendering */
.ai-commentary-body h1,
.ai-commentary-body h2,
.ai-commentary-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1A1E21;
    margin: 12px 0 6px 0;
}

.ai-commentary-body h1:first-child,
.ai-commentary-body h2:first-child,
.ai-commentary-body h3:first-child {
    margin-top: 0;
}

.ai-commentary-body p {
    margin: 6px 0;
}

.ai-commentary-body ul, .ai-commentary-body ol {
    margin: 6px 0;
    padding-left: 20px;
}

.ai-commentary-body li {
    margin: 3px 0;
}

.ai-commentary-body strong {
    color: #1A1E21;
    font-weight: 600;
}

.ai-commentary-body hr {
    border: none;
    border-top: 1px solid #E2E8F0;
    margin: 12px 0;
}
