
.mathgraph__wrapper {
    margin: 1.25rem 0;
}

.mathgraph__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.mathgraph__title {
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.mathgraph__fullscreen {
    border: 1px solid #d4d7dc;
    background: linear-gradient(#f8fafc, #f1f5f9);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    line-height: 1;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mathgraph__fullscreen:hover,
.mathgraph__fullscreen:focus-visible {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.mathgraph {
    border: 1px solid #d4d7dc;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    min-height: 100px;
    max-width: 100%;
    display: block;
}

.mathgraph--error {
    color: #b3261e;
    border-color: #b3261e;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.mathgraph-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mathgraph-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.mathgraph-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    width: min(92vw, 1100px);
    max-height: 90vh;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1;
}

.mathgraph-modal__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mathgraph-modal__label {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mathgraph-modal__close {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: #0f172a;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
}

.mathgraph-modal__close:hover,
.mathgraph-modal__close:focus-visible {
    background: #e2e8f0;
    outline: none;
}

.mathgraph--modal {
    width: 100%;
    height: 70vh;
    min-height: 420px;
}
