/* Advanced view: a full-viewport drawing surface under the shared header.
   All colors lean on the tokens rebarCalc.css defines. */

.advancedBody {
    overflow: hidden;
}

#advancedMain {
    flex: 1;
    min-height: 0;
    display: flex;
}

#drawArea {
    position: relative;
    flex: 1;
    min-height: 0;
    background: var(--card-bg);
}

#drawSvg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* Pointer events drive everything; stop the browser from panning/zooming
       the page with the same gestures. */
    touch-action: none;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

/* Floating tool clusters positioned by script (CSSOM only, per CSP). */
#selectionTools,
#drawTools {
    position: absolute;
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 5;
}

#drawTools {
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
}

#selectionTools button,
#drawTools button {
    font: inherit;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 5px 10px;
    cursor: pointer;
}

#selectionTools button:hover,
#drawTools button:hover {
    border-color: var(--border-strong);
}

#selectionTools label {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

#selectionTools input[type="number"] {
    width: 58px;
    font: inherit;
    font-size: 13px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 4px 6px;
}

#canvasHint {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

/* Hide the header legend when narrow; the switcher matters more here. */
@media (max-width: 640px) {
    .advancedBody .legend {
        display: none;
    }
}
