.ezwp-mathgraph-field { position: relative; }
.ezwp-mathgraph-label { margin-bottom: .5rem; font-weight: 600; }
.ezwp-mathgraph-canvas {
    position: relative;
    width: 100%;
    min-height: 240px;
    max-height: 900px;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    background: #fff;
}
.ezwp-mathgraph-board { width: 100%; height: 100%; border: 0 !important; }
.ezwp-mathgraph-board svg,
.ezwp-mathgraph-board svg * {
    box-sizing: content-box;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    line-height: normal;
}
.ezwp-mathgraph-board svg path,
.ezwp-mathgraph-board svg text { clip-path: none !important; }
.ezwp-mathgraph-board > .JXGtext { clip-path: none !important; }
.ezwp-mathgraph-empty {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 2rem;
    color: #64748b;
    text-align: center;
}
.ezwp-mathgraph-empty svg { width: 64px; height: 48px; fill: none; stroke: #5b73e8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ezwp-mathgraph-empty strong { color: #334155; }
.ezwp-mathgraph-empty span { font-size: 13px; }
.ezwp-mathgraph-warning {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
}
.ezwp-mathgraph-resize-handle {
    position: absolute;
    right: 2px;
    bottom: 2px;
    z-index: 8;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(255,255,255,.9);
    color: #94a3b8;
    cursor: ns-resize;
}
.ezwp-mathgraph-resize-handle:hover,
.ezwp-mathgraph-resize-handle:focus-visible,
.ezwp-mathgraph-resize-handle.is-resizing { color: #0d6efd; outline: 1px solid rgba(13,110,253,.4); }
.ezwp-mathgraph-resize-handle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ezwp-mathgraph-editor-modal .modal-body { display: grid; grid-template-columns: minmax(300px, 390px) 1fr; min-height: 0; padding: 0; overflow: hidden; }
.ezwp-mathgraph-controls { overflow: auto; padding: 20px; border-right: 1px solid #e2e8f0; background: #f8fafc; }
.ezwp-mathgraph-control-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ezwp-mathgraph-expression-row { display: grid; grid-template-columns: auto minmax(0,1fr) 42px 34px; align-items: center; gap: 8px; margin-bottom: 10px; }
.ezwp-mathgraph-mathfield, .ezwp-mathgraph-text-expression { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font-size: 18px; }
.ezwp-mathgraph-expression-row .form-control-color { width: 42px; height: 38px; padding: 3px; }
.ezwp-mathgraph-points-heading { margin-top: 22px; padding-top: 16px; border-top: 1px solid #dbe3ed; }
.ezwp-mathgraph-point-row { display: grid; grid-template-columns: auto minmax(70px,1fr) 64px 64px 42px 34px; align-items: center; gap: 7px; margin-bottom: 9px; }
.ezwp-mathgraph-point-row .form-control { min-width: 0; padding: 6px; }
.ezwp-mathgraph-point-row .form-control-color { width: 42px; height: 38px; padding: 3px; }
.ezwp-mathgraph-regions-heading { margin-top: 22px; padding-top: 16px; border-top: 1px solid #dbe3ed; }
.ezwp-mathgraph-region-row { margin-bottom: 12px; padding: 10px; border: 1px solid #dbe3ed; border-radius: 7px; background: #fff; }
.ezwp-mathgraph-region-header { display: grid; grid-template-columns: auto minmax(70px,1fr) 42px 34px; align-items: center; gap: 7px; margin-bottom: 9px; }
.ezwp-mathgraph-region-header .form-check { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; }
.ezwp-mathgraph-region-header .form-control-color { width: 42px; height: 36px; padding: 3px; }
.ezwp-mathgraph-region-expressions, .ezwp-mathgraph-region-range { display: grid; gap: 7px; }
.ezwp-mathgraph-region-expressions { grid-template-columns: 1fr 1fr; margin-bottom: 7px; }
.ezwp-mathgraph-region-range { grid-template-columns: 1fr 1fr 1fr; }
.ezwp-mathgraph-region-row label { color: #475569; font-size: 11px; }
.ezwp-mathgraph-region-row label .form-control { margin-top: 2px; padding: 5px 6px; }
.ezwp-mathgraph-axis-settings { margin-top: 22px; padding-top: 16px; border: 0; border-top: 1px solid #dbe3ed; }
.ezwp-mathgraph-axis-settings legend { float: none; width: auto; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.ezwp-mathgraph-bounds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ezwp-mathgraph-bounds label { color: #475569; font-size: 12px; }
.ezwp-mathgraph-bounds input { display: block; width: 100%; margin-top: 3px; padding: 7px 8px; border: 1px solid #cbd5e1; border-radius: 5px; }
.ezwp-mathgraph-axis-settings .form-check { display: flex; gap: 8px; margin: 8px 0; }
.ezwp-mathgraph-grid-style { display: block; margin: 10px 0; color: #475569; font-size: 12px; }
.ezwp-mathgraph-grid-style select { margin-top: 3px; }
.ezwp-mathgraph-editor-error { min-height: 22px; margin-top: 12px; color: #b91c1c; font-size: 13px; }
.ezwp-mathgraph-live-preview { min-width: 0; min-height: 0; padding: 16px; background: #fff; }
.ezwp-mathgraph-live-preview [data-ezwp-editor-board] { width: 100%; height: 100%; min-height: calc(100vh - 165px); border: 1px solid #d9e0ea !important; }
.ezwp-mathgraph-editor-status { margin-top: 2px; color: #64748b; font-size: 12px; }
@media (max-width: 800px) {
    .ezwp-mathgraph-editor-modal .modal-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(360px,1fr); overflow: auto; }
    .ezwp-mathgraph-controls { border-right: 0; border-bottom: 1px solid #e2e8f0; }
    .ezwp-mathgraph-live-preview [data-ezwp-editor-board] { min-height: 420px; }
}
