html, body { margin: 0; height: 100%; overflow: hidden; background: #fff; }

svg { touch-action: none; }

#box { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

:root { --editor-size: clamp(170px, min(34vw, 48vh), 400px); }
@media (max-width: 700px) {
    :root { --editor-size: clamp(170px, min(60vw, 42vh), 400px); }
}

#panel {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 1);
    border: 1px solid #999;
}

#grip {
    display: none;
    margin: -2px 0 8px;
    padding: 4px 0;
    text-align: center;
    font-size: 12px;
    color: #555;
    background: rgba(0, 0, 0, 0.15);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    height: 12px;
}
#grip.dragging { cursor: grabbing; }
@media (min-width: 701px) {
    #grip { display: block; }
}

#editor { display: block; width: var(--editor-size); height: auto; aspect-ratio: 1 / 1; }

#reload {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
    background: #ffff;
    border: 1px solid #999;
    font-size: 20px;
    height: 80px;
}
#reload:hover { background: #eee; }
#reload:focus-visible { outline: 2px solid blue; outline-offset: 2px; }

#tri { fill: rgba(0, 0, 0, 1); stroke: black; stroke-width: 2; vector-effect: non-scaling-stroke; }
.handle { fill: white; stroke: black; stroke-width: 3; cursor: grab; vector-effect: non-scaling-stroke; }
