.ems-graph {
    margin: 1rem 0;
    max-width: 100%;
}

.ems-graph-board {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    overflow: hidden;
    box-sizing: content-box;
    line-height: 0;
}

.ems-graph-board .ems-graph-svg {
    display: block;
    vertical-align: top;
}

.ems-graph-ticks text {
    user-select: none;
}

.ems-latex-preview .ems-graph,
.question-text-preview .ems-graph,
.tex2jax_process .ems-graph {
    margin: 0.75rem 0;
}

/* Compact graphs on question bank cards */
.ems-graph--compact {
    margin: 0.35rem 0;
}

.ems-graph--compact .ems-graph-board {
    width: 240px !important;
    height: 120px !important;
    max-width: 100%;
}

/* Full-size graphs in modals and previews */
.ems-graph--full .ems-graph-board,
.modal .ems-graph-board {
    max-width: 100%;
}

.modal .ems-graph--full .ems-graph-board {
    min-height: 200px;
}

/* Question bank table: text only, no graph thumbnails */
#questionTable .ems-graph,
#questionTableBody .ems-graph {
    display: none !important;
}

.modal .question-text-preview .ems-graph {
    overflow: visible;
}
