html, body, .dx-theme-compact {
    font-family: "Assistant", sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: white;
}

:root {
    --mdl-shape-toolbar-z-index: 90000;
    --mdl-shape-overlay-z-index: 91000;
    --mdl-shape-overlay-nested-z-index: 92000;
    --mdl-shape-toolbar-button-color: #253047;
    --mdl-shape-toolbar-button-hover-color: #0f6cbd;
    --mdl-shape-toolbar-button-hover-bg: rgba(15, 108, 189, 0.12);
    --mdl-shape-toolbar-button-active-bg: rgba(15, 108, 189, 0.18);
    --mdl-shape-toolbar-button-focus-ring: 0 0 0 2px rgba(15, 108, 189, 0.24);
}

svg {
    display: block;
    width: 100vw;
    height: 100vh;
    user-select: none;
}

#menu-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

#model-info-label {
    position: fixed;
    top: 20px;
    left: 72px;
    height: 36px;
    white-space: nowrap;
    user-select: none;
    z-index: 10;
    pointer-events: none;
    paint-order: stroke fill;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#model-name-label {
    font-size: 12px;
    line-height: 16px;
}

#model-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

#auto-save-icon {
    display: none;
    font-size: 11px;
    animation: save-pulse 1s ease-in-out infinite;
}

@keyframes save-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.about-heart {
    color: red;
    display: inline-block;
    animation: heart-pulse 3s ease-in-out infinite;
}

@keyframes heart-pulse {
    0%, 15%, 100% { transform: scale(1); }
    5% { transform: scale(1.3); }
    10% { transform: scale(1); }
}

.model-creator {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    line-height: 14px;
}

.model-creator-avatar {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    -webkit-text-stroke: 0;
}

.dx-overlay-wrapper {
    font-size: 15px;
}

.mdl-nested-dropdown-popup {
    z-index: var(--mdl-shape-overlay-nested-z-index) !important;
}

#chat-popup {
    display: flex;
    justify-content: center;
}

.mdl-chat-popup .dx-popup-content {
    padding: 0;
    overflow: hidden;
}

.mdl-chat-popup .dx-popup-content > .dx-template-wrapper,
.mdl-chat-popup .mdl-chat-host,
.mdl-chat-popup .dx-chat,
.mdl-chat-popup .dx-chat-alertlist,
.mdl-chat-popup .dx-chat-messagelist,
.mdl-chat-popup .dx-scrollview,
.mdl-chat-popup .dx-scrollable,
.mdl-chat-popup .dx-scrollable-wrapper,
.mdl-chat-popup .dx-scrollable-container,
.mdl-chat-popup .dx-scrollable-content {
    min-height: 0;
    min-width: 0;
}

.mdl-chat-popup .mdl-chat-host {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mdl-chat-popup .dx-chat {
    flex: 1 1 auto;
}

.mdl-chat-popup .dx-chat-messagebox-textarea-container {
    min-width: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.mdl-chat-popup .dx-chat-messagebox-textarea-container > .dx-chat-textarea {
    min-width: 0;
    flex-shrink: 0;
}

.mdl-chat-popup .dx-chat-messagebox {
    flex-shrink: 0;
}

.handle {
    fill: white;
    stroke: #4039d7;
    stroke-width: 1px;
    pointer-events: all;
    opacity: 1;
}

/* Shapes inside a referential (point, body, line, arc, vector) are dragged by
   small anchor/tip points. cursor inherits, so this covers their geometry and,
   via the move-handle passthrough, the drag handles too. */
.mdl-referential-child {
    cursor: crosshair;
}

.handle.top-left {
    cursor: nwse-resize;
    fill: #4039d7;
    stroke: none;
}

.handle.top-right {
    cursor: nesw-resize;
    fill: #4039d7;
    stroke: none;
}

.handle.bottom-left {
    cursor: nesw-resize;
    fill: #4039d7;
    stroke: none;
}

.handle.bottom-right {
    cursor: nwse-resize;
    fill: #4039d7;
    stroke: none;
}

.handle.edge-resize {
    fill: none;
    stroke: transparent;
    stroke-width: 8px;
    pointer-events: stroke;
    cursor: nwse-resize;
}

.handle.move {
    fill: transparent;
    cursor: move;
}

line.handle.move {
    stroke: transparent;
    stroke-width: 20px;
    fill: none;
}

path.handle.move {
    stroke: transparent;
    fill: none;
    pointer-events: stroke;
}

.handle.tip {
    fill: white;
    stroke: #4039d7;
    stroke-width: 1.5px;
    cursor: crosshair;
}

.handle.rotation {
    opacity: 1;
    fill: #ffffff;
    stroke: #4039d7;
    stroke-width: 1.5px;
    rx: 2px;
    ry: 2px;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 512 512'%3E%3Cdefs%3E%3Cfilter id='shadow' x='-25%25' y='-25%25' width='160%25' height='160%25'%3E%3CfeDropShadow dx='0' dy='18' stdDeviation='12' flood-color='%23000' flood-opacity='0.45'/%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23shadow)'%3E%3Cpath d='M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z' fill='none' stroke='%23fff' stroke-width='64' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z' fill='%23000'/%3E%3C/g%3E%3C/svg%3E") 8 8, crosshair;
}

.handle.origin {
    rx: 4px;
    ry: 4px;
    cursor: move;
}

.table-control-root:focus {
    outline: none;
}

.table-control-root:focus-visible {
    outline: none;
}

.handle.splitter {
    rx: 4px;
    ry: 4px;
    cursor: ns-resize;
}

.handle.gauge-pointer {
    cursor: grab;
}

.handle.gauge-pointer:active {
    cursor: grabbing;
}

.handle.radius {
    transform: translate(-4px, -4px);
    rx: 4px;
    ry: 4px;
    cursor: nwse-resize;
}

.handle.locked {
    cursor: not-allowed;
}

.handle.mindmap-connector-bend {
    fill: #4039d7;
    stroke: white;
    stroke-width: 1.5px;
    cursor: move;
}

.mdl-connection-target {
    fill: #4039d7;
    fill-opacity: 0.12;
    stroke: #4039d7;
    stroke-width: 2px;
    stroke-dasharray: 5 3;
}

.mdl-mindmap-text-host {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

.mdl-mindmap-text {
    width: 100%;
    max-height: 100%;
    overflow: hidden;
    text-align: center;
    font-family: "Nunito", sans-serif;
    line-height: 1.25;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
}

.mdl-mindmap-connector-label-host {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.mdl-mindmap-connector-label {
    display: inline-block;
    max-width: 260px;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Nunito", sans-serif;
    text-align: center;
    white-space: pre-wrap;
    word-break: break-word;
    outline: none;
    cursor: move;
    pointer-events: auto;
}

.mdl-mindmap-connector-label[contenteditable="true"] {
    cursor: text;
}

.rotation-handle {
    fill: white;
    stroke: #4039d7;
    cursor: pointer;
    rx: 5px;
    ry: 5px;
}

.resize-handle {
    fill: white;
    stroke: #4039d7;
    cursor: pointer;
    rx: 1px;
    ry: 1px;
}

.rotation-handle {
    fill: white;
    stroke: #4039d7;
    cursor: pointer;
    rx: 5px;
    ry: 5px;
}

.bounding-box {
    stroke: #4039d7;
    stroke-dasharray: 1;
    fill: transparent;
    cursor: move;
}

.hover-outline {
    stroke: #4039d7;
    stroke-dasharray: 3 2;
    fill: transparent;
    pointer-events: none;
}

.selected-outline {
    stroke: #4039d7;
    fill: transparent;
    pointer-events: none;
}

svg.shape-draw-mode,
svg.shape-draw-mode * {
    cursor: crosshair !important;
}

svg.pan-available {
    cursor: grab;
}

svg:active.pan-available {
    cursor: grabbing;
}

.minimap-container {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 150px;
    height: 150px;
}

.minimap-image {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(128, 128, 128, 0.8);
    background-color: rgba(255, 255, 255, 0.8);
}

.minimap-viewport {
    position: absolute;
    border: 1px solid rgba(50, 50, 50, 0.2);
    background-color: rgba(200, 200, 200, 0.1);
}

@font-face {
    font-family: "LatinModernMath";
    src: url("../../libraries/css/font/latinmodern-math.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "KatexMainRegular";
    src: url("../../libraries/css/font/KaTeX_Main-Regular.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Katex_Main";
    src: url("../../libraries/css/font/KaTeX_Main-Regular.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "KatexMainItalic";
    src: url("../../libraries/css/font/KaTeX_Main-Italic.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Katex_Math";
    src: url("../../libraries/css/fonts/KaTeX_Math-Italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: "Katex_Math";
    src: url("../../libraries/css/fonts/KaTeX_Math-BoldItalic.woff2") format("woff2");
    font-weight: 700;
    font-style: italic;
}


.shape-context-toolbar {
    position: fixed;
    z-index: var(--mdl-shape-toolbar-z-index);
    display: none;
    padding: 4px 6px;
    border-radius: 8px;
    background: transparent;
    width: max-content;
}

.shape-context-toolbar.visible {
    display: block;
}

.mdl-background-toolbar .mdl-background-toolbar-name {
    display: flex;
    align-items: center;
}

.mdl-background-toolbar-check {
    margin-left: auto;
    padding-left: 12px;
}

.shape-context-toolbar .dx-toolbar {
    background: transparent;
    box-shadow: none;
    padding: 0;
    width: auto;
    display: inline-block;
}

.shape-context-toolbar .dx-toolbar-items-container {
    gap: 4px;
    overflow: visible;
}

.shape-context-toolbar .dx-toolbar-item,
.shape-context-toolbar .dx-toolbar-item.dx-toolbar-button,
.shape-context-toolbar .dx-toolbar-item-content,
.shape-context-toolbar .dx-toolbar-item-auto-hide,
.shape-context-toolbar .dx-toolbar-item .dx-button,
.shape-context-toolbar .dx-toolbar-item .dx-button-content,
.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text {
    box-shadow: none;
    background: transparent;
    border-color: transparent;
}

.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text {
    color: var(--mdl-shape-toolbar-button-color);
    border-radius: 8px;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text.dx-state-hover,
.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text.dx-state-selected {
    background: var(--mdl-shape-toolbar-button-hover-bg);
    border-color: transparent;
    color: var(--mdl-shape-toolbar-button-hover-color);
}

.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text.dx-state-focused {
    background: var(--mdl-shape-toolbar-button-hover-bg);
    border-color: transparent;
    color: var(--mdl-shape-toolbar-button-hover-color);
    box-shadow: var(--mdl-shape-toolbar-button-focus-ring);
}

.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text.dx-state-active {
    background: var(--mdl-shape-toolbar-button-active-bg);
    border-color: transparent;
    color: var(--mdl-shape-toolbar-button-hover-color);
}

.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text .dx-icon,
.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text .dx-button-text,
.shape-context-toolbar .dx-toolbar-item .dx-button-mode-text .mdl-focused-toolbar-button {
    color: inherit;
}

.mdl-focused-delete-rows .dx-button {
    min-width: 32px;
}

.mdl-focused-term-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(37, 48, 71, 0.18);
    background: transparent;
    flex: 0 0 auto;
}

.mdl-focused-term-name {
    white-space: nowrap;
}

.mdl-focused-regression-term-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    min-width: 220px;
}

.mdl-focused-regression-term-menu-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mdl-focused-regression-term-menu-row--stacked {
    flex-direction: column;
    align-items: stretch;
}

.mdl-focused-regression-term-menu-label {
    color: #4b5670;
    font-size: 12px;
    min-width: 40px;
}

.mdl-focused-regression-term-menu-input {
    width: 100%;
}

.mdl-actions-context-menu {
    z-index: 99999 !important;
}

.mdl-actions-context-menu .dx-submenu {
    z-index: 100000 !important;
}

.vector-term-toolbar-item {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 130px;
}

.vector-term-toolbar-label {
    font-size: 11px;
    color: #666;
    flex: 0 0 auto;
}

.vector-term-toolbar-item .term-packed-control {
    flex: 1 1 auto;
    min-width: 0;
}

.thumbnail-dropzone {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #f7f9fb;
    cursor: pointer;
    position: relative;
}

.thumbnail-preview {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
}

.thumbnail-preview:not([src]),
.thumbnail-preview[src=""] {
    display: none;
}

.thumbnail-hint {
    font-size: 0.9rem;
    color: #6b7280;
}

.thumbnail-uploader {
    display: none;
}

.thumbnail-remove-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.thumbnail-remove-button .trash,
.shape-image-dropzone__remove .trash {
    font-weight: 300;
    color: red;
}

.thumbnail-remove-button:hover .trash,
.shape-image-dropzone__remove:hover .trash {
    display: none;
}

.thumbnail-remove-button:hover .trash-hover,
.shape-image-dropzone__remove:hover .trash-hover {
    display: inline-block;
    font-weight: 900;
    color: red;
}

.shape-image-dropzone {
    display: grid;
    place-items: center;
    min-height: 120px;
    padding: 12px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #f7f9fb;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.shape-image-dropzone.drag-over {
    border-color: #4039d7;
    background: #eef0ff;
}

.shape-image-dropzone__hint {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
}

.shape-image-dropzone__preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
    cursor: grab;
}

.shape-image-dropzone__preview:not([src]),
.shape-image-dropzone__preview[src=""] {
    display: none;
}

.shape-image-dropzone__uploader {
    display: none;
}

.shape-image-dropzone__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.dx-datagrid .dx-header-row .dx-datagrid-text-content {
    font-family: "Times New Roman";
    font-size: 18.4px;
    font-style: italic !important;
    font-weight: normal;
}

.dxc-legend .dxc-item {
    font-family: "Times New Roman" !important;
    font-size: 18.4px !important;
    font-style: italic;
    font-weight: normal;
    color: #242424 !important;
}

.dx-htmleditor {
    border: none !important;
    box-shadow: none !important;
}

.dx-htmleditor .dx-htmleditor-content {
    cursor: inherit;
}

.dx-htmleditor .dx-htmleditor-content img {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: default;
}

.dx-htmleditor .dx-htmleditor-content .ql-formula {
    padding: 2px 4px;
    vertical-align: middle;
}

/* The shared toolbar section card (common.css) shows up as a dark band under
   the floating text editor toolbar, which draws its own border. */
.mdl-text-editor-toolbar .dx-toolbar-before,
.mdl-text-editor-toolbar .dx-toolbar-center,
.mdl-text-editor-toolbar .dx-toolbar-after {
    box-shadow: none;
}

.shape-terms-list .shape-term-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #666;
}

.shape-terms-list .shape-term-drag-handle:active {
    cursor: grabbing;
}

.shape-terms-list .shape-term-drag-handle .dx-icon {
    font-size: 16px;
}

.shape-terms-list .dx-list-reorder-handle-container,
.shape-terms-list .dx-list-reorder-handle {
    display: none !important;
}

.shape-terms-list .dx-list-item-content {
    padding-left: 0;
}

.dx-numberbox .dx-texteditor-input {
    text-align: right;
}

.dx-datagrid .dx-revert-button {
    display: none !important;
}

.mdl-preloaded-data-grid .dx-header-row td {
    background-color: #ededed;
}

.mdl-preloaded-data-grid .dx-header-row .dx-datagrid-text-content {
    font-family: "KaTeX_Math";
    font-size: 16px;
    font-style: italic;
    font-weight: normal;
}

.mdl-preloaded-data-grid .dx-data-row td {
    font-family: "KaTeX_Main";
    font-size: 12px;
}

.tooltip {
    text-wrap-mode: wrap; 
}





.mdl-button-text {
    font-size: 11px;
    line-height: 1;
}

.mdl-math-input .dx-texteditor-input {
    font-family: 'KaTeX_Math', serif;
    font-size: 16px;
}





.mdl-parent-btn-character {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.mdl-name-btn-character {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}


.mdl-parent-tree-character {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

.mdl-parent-selector-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    padding: 2px;
    border-radius: 4px;
}

.mdl-parent-selector-icon:hover {
    background: rgba(0,0,0,0.06);
}

.mdl-parent-inline-tree {
    padding-top: 4px;
}

.mdl-dropdown-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px 10px;
    padding: 8px 12px;
}

.mdl-dropdown-grid-label {
    font-size: 13px;
    white-space: nowrap;
}

.mdl-dropdown-grid-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

/* A row of axis bounds fills its cell and its boxes share the width, so a long value scrolls
   inside its box instead of widening the menu past its edge. */
.mdl-axis-range-row {
    display: flex;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.mdl-axis-range-box {
    flex: 1 1 0;
    min-width: 0;
}

.mdl-axis-range-box .dx-numberbox {
    width: 100%;
}

.mdl-collab-panel {
    padding: 4px 0;
}

.mdl-collab-list-host .dx-list-item-content {
    padding: 4px 8px;
}

.mdl-collab-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.mdl-collab-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e0e0e0;
}

.mdl-collab-name {
    flex-grow: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdl-collab-remove-host .dx-button {
    min-width: unset;
}

.mdl-collab-add-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.mdl-collab-search-host {
    flex-grow: 1;
}

.mdl-collab-add-btn-host .dx-button {
    min-width: unset;
}

.mdl-collab-dropdown .dx-overlay-content {
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mdl-collab-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mdl-collab-host {
    display: flex;
    align-items: center;
}

.mdl-collab-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    padding: 4px 8px 6px;
}

.mdl-collab-role {
    margin-left: auto;
    font-size: 11px;
    color: #6b7280;
}

.mdl-collab-stop-row {
    border-top: 1px solid rgba(107, 114, 128, 0.2);
    margin-top: 6px;
    padding-top: 4px;
}

.mdl-collab-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 9px;
    margin-right: 4px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.mdl-collab-status i {
    font-size: 8px;
}

.mdl-collab-status-live {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.mdl-collab-status-live i {
    animation: collab-live-pulse 2s ease-in-out infinite;
}

.mdl-collab-status-connecting,
.mdl-collab-status-reconnecting {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.mdl-collab-status-stopped {
    background: rgba(107, 114, 128, 0.16);
    color: #4b5563;
}

@keyframes collab-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

#save-error-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #b91c1c;
}

.mdl-collab-facepile {
    display: flex;
    align-items: center;
    padding-left: 6px;
}

.mdl-collab-facepile .mdl-face {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--mdl-toolbar-bg, #ffffff);
    background: #e0e0e0;
    margin-left: -8px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    overflow: hidden;
}

.mdl-collab-facepile .mdl-face:first-child {
    margin-left: 0;
}

.mdl-collab-facepile .mdl-face-more {
    background: #6b7280;
}

.mdl-dropdown-grid-full {
    grid-column: 1 / -1;
}

.mdl-parent-selector .dx-button-content i,
.mdl-shape-color-selector .dx-button-content i,
.mdl-motion-selector .dx-button-content i,
.mdl-add-shape-selector .dx-button-content i,
.mdl-settings-selector .dx-button-content i,
.mdl-shape-color-btn i {
    font-size: 18px;
}

.mdl-shape-color-selector .dx-button-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
}

.mdl-name-selector .dx-button-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    overflow: hidden;
    white-space: nowrap;
}

.mdl-name-btn-label {
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdl-name-btn-term {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.mdl-name-btn-icon {
    font-size: 12px;
    line-height: 1;
}

.mdl-name-btn-separator {
    font-size: 6px;
    line-height: 1;
    margin: 0 4px;
}

/* The mark a key wears while it is waiting to be handed a term: the same one that stands between two
   of them, standing alone where a name will go, and faded the way the word it replaced was. */
.mdl-name-btn-empty {
    font-size: 12px;
    line-height: 1;
    opacity: 0.5;
}

.mdl-name-btn-term-text {
    font-family: KaTeX_Math, serif;
    font-style: italic;
    font-size: 13px;
    line-height: 1;
}

.mdl-missing-term,
.mdl-missing-term math-field,
.mdl-missing-term .mdl-term-editor-math-field,
.mdl-missing-term .form-math-field {
    color: #d13438 !important;
}

.mdl-missing-term.dx-dropdownbox {
    background-color: rgba(209, 52, 56, 0.08);
}

.mdl-name-btn-extra {
    font-size: 10px;
    line-height: 1;
    padding: 1px 4px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.10);
    margin-left: 2px;
}

.mdl-shape-color-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    box-sizing: border-box;
}

.mdl-shape-color-btn-thumb {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.mdl-shape-color-popup-content {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}


@keyframes iconpop {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.7) rotate(-8deg); }
    100% { transform: scale(1.3); }
}

@keyframes mdlWandSpin {
    0%   { transform: rotate(0deg) scale(1); }
    25%  { transform: rotate(-15deg) scale(1.2); }
    75%  { transform: rotate(15deg) scale(1.2); }
    100% { transform: rotate(0deg) scale(1); }
}

.mdl-wand-loading .dx-icon {
    animation: mdlWandSpin 0.6s ease-in-out infinite;
    opacity: 0.7;
}

.dx-button.dx-item-selected .dx-icon {
    animation: iconpop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.mdl-display-options-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    padding: 0 4px;
    min-width: 16px;
}

.mdl-display-option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    white-space: nowrap;
}

.mdl-display-options-panel {
    position: fixed;
    z-index: 9999;
    display: none;
    background: var(--dx-color-main-bg, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    padding: 4px;
}

.mdl-display-options-panel.visible {
    display: block;
}

.mdl-variable-selector {
    font-family: "Katex_Math" !important;
    font-size: 13px;   
    font-weight: 400;
    font-style: italic;
}

.case-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.case-select__label {
    font-size: 12px;
    line-height: 1;
}

.case-select__icon {
    font-size: 14px;
    margin-right: 6px;
}

.case-select__input {
    padding-left: 30px !important;
}

.shape-term-term {
    width: 100%;
    min-width: 0;
}

.shape-term-secondary {
    width: 100%;
    min-width: 0;
}

.shape-term-color {
    width: 100%;
    min-width: 0;
}

.shape-term-lock {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-term-secondary-dropdown .dx-button {
    width: 100%;
    min-height: 32px;
    padding: 0;
    background: #f5f5f5;
}

.shape-term-secondary-dropdown .dx-button-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-term-secondary-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-term-secondary-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-term-secondary-icon.case-select__icon {
    margin: 0;
}

.character-shape-picker .dx-buttongroup-item {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
}

.character-shape-picker .dx-buttongroup-wrapper {
    align-items: stretch;
}

.character-shape-picker .dx-item {
    height: 50px !important;
    min-height: 50px !important;
}

.character-shape-picker .dx-item-content {
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 !important;
}

.character-shape-picker .dx-buttongroup-item .dx-button {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 !important;
}

.character-shape-picker .dx-buttongroup-item .dx-button-content {
    width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-shape-picker .dx-buttongroup-item .dx-button-content img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block;
}

.character-shape-picker .dx-buttongroup-item .dx-button-content .dx-icon {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    background-size: contain !important;
    background-position: center;
}

.term-packed-control {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

.term-packed-control__button {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    margin: 0;
    padding: 0;
    flex: 0 0 34px;
}

.term-packed-control__select {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.term-packed-control__units {
    flex: 0 0 58px;
    width: 58px;
    margin-left: 4px;
}

.term-packed-checkbox {
    margin: 0;
    padding: 0;
    width: 34px;
    min-width: 34px;
    height: 32px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background-color: #f5f5f5;
}

.term-packed-checkbox .dx-checkbox-container {
    width: 34px;
    height: 32px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.term-packed-checkbox .dx-checkbox-icon {
    width: 34px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.term-packed-checkbox.dx-state-focused .dx-checkbox-icon,
.term-packed-checkbox.dx-state-hover .dx-checkbox-icon,
.term-packed-checkbox.dx-checkbox-checked .dx-checkbox-icon,
.term-packed-checkbox.dx-checkbox-checked.dx-state-focused .dx-checkbox-icon,
.term-packed-checkbox.dx-checkbox-checked.dx-state-hover .dx-checkbox-icon,
.term-packed-checkbox.dx-checkbox-checked.dx-state-active .dx-checkbox-icon {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.term-packed-checkbox .dx-checkbox-icon::before,
.term-packed-checkbox .dx-checkbox-icon::after {
    display: none;
}

.term-packed-checkbox .term-packed-checkbox-icon {
    font-size: 14px !important;
    line-height: 1;
    color: #4d4d4d !important;
}

.term-packed-control__select .dx-texteditor {
    border-radius: 4px;
    margin: 0;
}

.term-packed-control--physical {
    align-items: center;
    gap: 0;
}

.mdl-physical-term-label {
    font-family: KaTeX_Math, serif;
    font-style: italic;
    font-size: 15px;
    line-height: 1;
    padding-left: 6px;
    color: inherit;
    opacity: 0.8;
}

.term-packed-control__select .dx-field-item-content {
    padding: 0;
    margin: 0;
}

.term-packed-terms-control,
.term-packed-terms-list {
    width: 100%;
}

.term-packed-terms-list .dx-list-item,
.term-packed-terms-list .dx-list-item-content {
    padding: 0;
}

.term-packed-terms-list .dx-scrollview-content {
    padding: 0;
}

.name-packed-control {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
}

.name-packed-control__button {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    margin: 0;
    padding: 0;
    flex: 0 0 34px;
}

.name-packed-control__color {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    margin: 0;
    padding: 0;
    flex: 0 0 34px;
}

.name-packed-control__size {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
    margin: 0;
    padding: 0;
    flex: 0 0 68px;
}

.name-packed-control__size .dx-texteditor {
    border-radius: 0;
    margin: 0;
}

.name-packed-control__input {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.name-packed-control__color .mdl-color-picker {
    width: 100%;
}

.name-packed-control__color .dx-button {
    min-height: 34px;
    border-radius: 0;
}

.name-packed-control__input .dx-texteditor {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin: 0;
}

.name-packed-control__input .dx-field-item-content {
    padding: 0;
    margin: 0;
}

.shape-name-label {
    font-family: "Segoe UI", sans-serif;
    font-size: 10px;
    dominant-baseline: auto;
    pointer-events: none;
}

.shape-name-label-bg {
    pointer-events: none;
}

.shape-term-case-icon-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-term-case-icon {
    font-size: 9px;
    line-height: 1;
}

.shape-term-label {
    font-family: "Katex_Math";
    font-size: 10px;
    dominant-baseline: hanging;
    pointer-events: none;
}

.mdl-pulse {
    animation: mdl-pulse-beat 1000ms ease-in-out infinite;
}

@keyframes mdl-pulse-beat {
    0% {
        filter: brightness(1) drop-shadow(0 0 0 var(--mdl-pulse-color)) drop-shadow(0 0 0 var(--mdl-pulse-color));
    }
    45% {
        filter: brightness(1.35) drop-shadow(0 0 5px var(--mdl-pulse-color)) drop-shadow(0 0 16px var(--mdl-pulse-color));
    }
    90%, 100% {
        filter: brightness(1) drop-shadow(0 0 0 var(--mdl-pulse-color)) drop-shadow(0 0 0 var(--mdl-pulse-color));
    }
}

.dx-texteditor-input-container .case-select__icon {
    margin-right: 0;
    margin-left: 8px;
}

.mdl-character-picker .dx-button {
    width: 100%;
    min-height: 32px;
    padding: 0;
    background: #f5f5f5;
}

.mdl-character-picker .dx-button-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdl-character-picker-button-template {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdl-character-picker-button-template img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.mdl-character-picker-button-icon {
    font-size: 18px;
    line-height: 1;
}

.mdl-character-picker-menu .dx-popup-content {
    padding: 6px;
}

.mdl-character-picker-menu .dx-tile,
.mdl-character-picker-menu .dx-tile-content {
    padding: 0;
}

.mdl-character-picker-menu .dx-tileview-wrapper,
.mdl-character-picker-menu .dx-scrollable-content {
    margin: 0;
    padding: 0;
}

.mdl-character-picker-menu .dx-tile {
    background: transparent;
    border: none;
    box-shadow: none;
}

.mdl-character-picker-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.mdl-character-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mdl-character-picker-item .fa-ban {
    font-size: 24px;
    color: #aaa;
}

.mdl-character-picker-menu .dx-tile.dx-state-hover .mdl-character-picker-item,
.mdl-character-picker-menu .dx-tile.dx-state-active .mdl-character-picker-item {
    background: #e8e8e8;
}

.shape-svg-chart {
    width: 100%;
    height: 100%;
}

.shape-svg-chart svg {
    display: block;
}

.value-shape-editor {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.value-shape-editor .dx-texteditor,
.value-shape-editor .dx-numberbox,
.value-shape-editor .dx-texteditor-container,
.value-shape-editor .dx-texteditor-input-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: none !important;
    padding: 0 !important;
}

.value-shape-editor .dx-texteditor-input {
    font-family: "Katex_Main";
    font-size: 14px;
    text-align: left;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    line-height: 1;
}

.value-shape-editor .dx-numberbox-spin-container {
    display: none !important;
}

/* Pulse animation for play/pause button when holding space */
@keyframes mdl-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(64,57,215,0.30); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(64,57,215,0.0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(64,57,215,0.0); }
}

#playPauseButton.pulsing,
#playPauseButton.pulsing .dx-button-content {
    animation: mdl-pulse 1s ease-in-out infinite;
}

.referential-axis-line {
    opacity: 0.6;
}

.referential-grid-line {
    opacity: 0.2;
    stroke-dasharray: 2 2;
}


.referential-tick-label {
    font-family: "Katex_Main";
    font-size: 8px;
    opacity: 0.6;
    user-select: none;
    -webkit-user-select: none;
}

.shape-tick-label {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

.chart-tick-handle-x {
    cursor: ew-resize;
}

.chart-tick-handle-y {
    cursor: ns-resize;
}

.mid-school math-field {
    --text-font-family: "Indie Flower", cursive;
    font-size: 20px;
}

.mid-school .ML__latex {
    font-family: "Indie Flower", cursive !important;
}

.mid-school .referential-tick-label {
    font-family: "Indie Flower", cursive;
    font-size: 15px;
}

.mid-school .mdl-math-input .dx-texteditor-input {
    font-family: "Indie Flower", cursive;
    font-size: 22px;
}

.mid-school .mdl-preloaded-data-grid .dx-header-row .dx-datagrid-text-content {
    font-family: "Indie Flower", cursive;
    font-size: 22px;
    font-style: normal;
}

.mid-school .mdl-preloaded-data-grid .dx-data-row td {
    font-family: "Indie Flower", cursive;
    font-size: 18px;
}

.mid-school .shape-tick-label {
    font-family: "Indie Flower", cursive;
}

.mid-school #svg text,
.mid-school #svg tspan {
    font-family: "Indie Flower", cursive !important;
}

.mid-school #svg {
    filter: url(#sketchy-line);
}

.mdl-term-tree-popup .dx-overlay-content {
    padding: 0;
}

.mdl-term-tree-popup .dx-popup-content {
    padding: 0;
}

.mdl-term-tree-content {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.mdl-term-tree-view .dx-treeview-item-content {
    font-family: "Katex_Math";
    font-size: 13px;
    font-style: italic;
}

.mdl-term-tree-view .dx-treeview-item {
    padding-top: 3px !important;
    padding-right: 0 !important;
    padding-bottom: 3px !important;
    padding-left: 0 !important;
}

.feedback-toast .dx-toast-content {
    background-color: #86efac;
    color: #166534;
    text-align: center;
}

.mdl-catalog-data-popup .dx-popup-content {
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}

.mdl-character-picker-popup .dx-popup-content {
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
    height: 100%;
}

.mdl-character-picker-popup .mdl-catalog-data-thumb {
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--dx-color-bg-hover, #f0f2f5);
}

.mdl-character-picker-popup .mdl-catalog-data-thumb-placeholder {
    aspect-ratio: 1;
}

.card-desc-tooltip {
    text-align: left;
}

.card-desc-tooltip strong {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    text-align: center;
}

.card-desc-tooltip p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.mdl-catalog-data-scroll {
    height: 100%;
    overflow-y: auto;
}

.mdl-char-picker-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.25rem;
}

.mdl-char-picker-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mdl-char-picker-scroll {
    flex: 1;
    min-height: 0;
}

.mdl-char-picker-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dx-color-secondary-text, #6b7280);
    margin-bottom: 0.5rem;
}

.mdl-char-picker-search-bar {
    padding: 0.5rem 0.25rem 0.375rem;
    flex-shrink: 0;
}

.mdl-char-picker-search-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--dx-color-border, #d1d5db);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    outline: none;
    background: var(--dx-color-bg, #fff);
    color: var(--dx-color-main-text, #111827);
}

.mdl-char-picker-search-input:focus {
    border-color: var(--dx-color-main-text, #5c7cfa);
    box-shadow: 0 0 0 2px rgba(92, 124, 250, 0.2);
}


.mdl-catalog-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
    padding: 2px;
}

.mdl-catalog-data-card {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: var(--dx-color-bg, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.mdl-catalog-data-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    border-color: var(--dx-color-main-text, #5c7cfa);
}

.mdl-catalog-data-card.selected {
    border-color: var(--dx-color-main-text, #5c7cfa);
    box-shadow: 0 0 0 3px rgba(92, 124, 250, 0.25);
}

.mdl-catalog-data-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.mdl-catalog-data-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dx-color-bg-hover, #f0f2f5);
    font-size: 28px;
    opacity: 0.4;
}

.mdl-catalog-data-title {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdl-catalog-data-status {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    opacity: 0.6;
}

.mdl-catalog-data-tooltip {
    z-index: 100000 !important;
}

.mdl-object-picker-popup .dx-popup-content {
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
    height: 100%;
}

.mdl-object-picker {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mdl-object-picker-body {
    padding: 0.25rem;
}

.mdl-object-picker-popup .mdl-catalog-data-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.mdl-object-picker-preview {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dx-color-bg-hover, #f0f2f5);
    padding: 8px;
    box-sizing: border-box;
}

.mdl-object-picker-preview svg {
    width: 100%;
    height: 100%;
}

.mdl-object-picker-preview img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.mdl-object-picker-preview .mdl-catalog-data-thumb-placeholder {
    aspect-ratio: 1;
    background: none;
}

.mdl-object-picker-card .mdl-catalog-data-title {
    padding-bottom: 2px;
}

.mdl-object-picker-description {
    margin: 0 8px 8px;
    font-size: 11px;
    line-height: 1.35;
    max-height: 4.05em;
    color: var(--dx-color-secondary-text, #6b7280);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dx-gallery .dx-gallery-nav-button-prev::before,
.dx-gallery .dx-gallery-nav-button-next::before {
    font-family: "Font Awesome 7 Pro";
    font-weight: 300;
    font-style: normal;
}

.dx-gallery .dx-gallery-nav-button-prev::before {
    content: "\f053";
}

.dx-gallery .dx-gallery-nav-button-next::before {
    content: "\f054";
}

.mdl-question-shape {
    font-family: "Assistant", sans-serif;
    padding: 12px;
    border-radius: 4px;
}

.mdl-question-shape .dx-texteditor-input,
.mdl-question-shape .dx-list-item-content,
.mdl-question-shape .dx-placeholder::before,
.mdl-question-shape .dx-texteditor {
    color: inherit !important;
}

.mdl-question-answer-section,
.mdl-question-answer-section .dx-list-item,
.mdl-question-answer-section .dx-texteditor-input,
.mdl-question-answer-section .dx-texteditor,
.mdl-question-answer-section .dx-placeholder::before,
.mdl-question-answer-section .dx-list-item-content,
.mdl-question-answer-section .mdl-question-list-item {
    color: inherit !important;
}

.mdl-question-image-section {
    flex-shrink: 0;
    max-height: 45%;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.mdl-question-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.mdl-question-image-dropdown {
    padding: 8px;
    box-sizing: border-box;
}

.mdl-question-catalog-image {
    margin-top: 6px;
    display: flex;
    justify-content: center;
}

.mdl-question-section {
    margin-bottom: 10px;
    flex-shrink: 0;
}

.mdl-question-header-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.mdl-question-number-host {
    flex-shrink: 0;
}

.mdl-question-number-label {
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.mdl-question-input-host {
    flex: 1;
    min-width: 0;
}

.mdl-question-text-label {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.mdl-question-answer-section {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mdl-question-freetext-host {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mdl-question-freetext-host .dx-textarea {
    flex: 1;
}

.mdl-question-freetext-host .dx-texteditor-container {
    height: 100%;
}

.mdl-question-freetext-host .dx-texteditor-input-container {
    height: 100%;
}

.mdl-question-list-host {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.mdl-question-list-host .dx-list-item {
    padding: 4px 0;
}

.mdl-question-list-host .dx-list-item,
.mdl-question-list-host .dx-list-item-content {
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
}

.mdl-question-list-host .dx-list-reorder-handle-container,
.mdl-question-list-host .dx-list-reorder-handle {
    display: none !important;
}

.mdl-question-list-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.mdl-question-item-correct-host,
.mdl-question-item-check-host {
    margin-top: 5px;
}

.mdl-question-item-name-host {
    flex-shrink: 0;
}

.mdl-question-item-text-host {
    flex: 1;
    min-width: 0;
}

.mdl-question-item-score-host {
    flex-shrink: 0;
}

.mdl-question-item-correct-host {
    flex-shrink: 0;
}

.mdl-question-item-remove {
    flex-shrink: 0;
    cursor: pointer;
    color: #999;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
}

.mdl-question-item-remove:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.08);
}

.mdl-question-add-button {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #0f6cbd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: background-color 0.15s, transform 0.15s;
}

.mdl-question-add-button:hover {
    background-color: #0a548a;
    transform: scale(1.1);
}

.mdl-scoring-icon {
    font-size: 13px;
    width: 1.5em;
    height: 1.5em;
    line-height: 1.5em;
}

.mdl-scoring-icon-sm {
    font-size: 12px;
    width: 1.4em;
    height: 1.4em;
    line-height: 1.4em;
}

.mdl-scoring-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}

.mdl-question-item-check-host {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.mdl-question-item-check-host input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0078d4;
}

.mdl-question-item-correct-host input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0078d4;
}

.mdl-question-item-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.mdl-question-item-label .mdl-question-item-name {
    font-weight: 600;
    font-size: 14px;
    min-width: 20px;
    flex-shrink: 0;
}

.mdl-question-item-label .mdl-question-item-text {
    font-size: 14px;
    min-width: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.mdl-question-item-score-badge {
    font-size: 12px;
    font-weight: 600;
    color: #28a745;
    padding: 2px 8px;
    border-radius: 10px;
    background-color: rgba(40, 167, 69, 0.1);
    white-space: nowrap;
}

.mdl-question-item-score-badge.mdl-question-item-failed {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.mdl-question-item-answered {
    background-color: rgba(40, 167, 69, 0.04);
    border-radius: 4px;
}

.mdl-question-item-answered.mdl-question-item-failed {
    background-color: rgba(220, 53, 69, 0.04);
}

.mdl-bg-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
    padding: 4px;
}

.mdl-shape-select-dropdown .dx-treeview {
    max-height: 320px !important;
    overflow-y: auto;
}

.mdl-bg-picker-card {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: var(--dx-color-bg, #fff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
}

.mdl-bg-picker-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-color: var(--dx-color-main-text, #5c7cfa);
}

.mdl-bg-picker-card.selected {
    border-color: var(--dx-color-main-text, #5c7cfa);
    box-shadow: 0 0 0 2px rgba(92, 124, 250, 0.2);
}

.mdl-bg-picker-thumb {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdl-bg-picker-thumb svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mdl-bg-picker-none {
    background: var(--dx-color-bg-hover, #f0f2f5);
    font-size: 20px;
    opacity: 0.5;
}

.mdl-bg-picker-label {
    padding: 3px 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
