.geometry-page .container-row,
.geometry-page .visul-container {
    min-height: 640px;
}

.geometry-page .visul-container {
    height: auto !important;
}

.geometry-visualization {
    display: grid;
    grid-template-columns: minmax(520px, 780px) minmax(190px, 240px);
    gap: 20px;
    align-items: start;
    width: min(1060px, 100%);
    min-width: 760px;
    margin: 0 auto;
    padding: 18px 22px;
}

.graham-coordinate-plane {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    font-family: "IBM Plex Mono", monospace;
}

.graham-grid-line {
    stroke: rgba(20, 33, 31, 0.11);
    stroke-width: 1;
}

.graham-axis {
    stroke: #344640;
    stroke-width: 1.5;
}

.graham-axis-label {
    fill: #66716c;
    font-size: 11px;
}

.graham-axis-title,
.graham-canvas-title {
    fill: #14211f;
    font-size: 15px;
    font-weight: 600;
}

.graham-canvas-caption {
    fill: #66716c;
    font-size: 12px;
}

.graham-hull-line {
    fill: none;
    stroke: #29826a;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.graham-polar-ray {
    stroke: rgba(41, 130, 106, 0.48);
    stroke-dasharray: 4 5;
    stroke-width: 1.5;
}

.graham-order-label {
    fill: #66716c;
    font-size: 10px;
    font-weight: 600;
}

.graham-comparison {
    fill: rgba(240, 116, 92, 0.14);
    stroke: #e5674c;
    stroke-dasharray: 5 4;
    stroke-linejoin: round;
    stroke-width: 2;
}

.graham-point {
    fill: #fff;
    stroke: #344640;
    stroke-width: 2;
}

.graham-point-outline {
    fill: #b9efc5;
    stroke: #29826a;
    stroke-width: 3;
}

.graham-point-outline.is-pivot {
    fill: #d8f36a;
    stroke: #536b22;
}

.graham-point.is-pivot {
    fill: #d8f36a;
    stroke: #536b22;
    stroke-width: 3;
}

.graham-point.is-in-stack {
    fill: #b9efc5;
    stroke: #29826a;
    stroke-width: 3;
}

.graham-point.is-candidate,
.graham-point.is-popped {
    fill: #f0745c;
    stroke: #a63d2b;
    stroke-width: 3;
}

.graham-point-label {
    fill: #344640;
    font-size: 11px;
    font-weight: 600;
    paint-order: stroke;
    stroke: #edf2ec;
    stroke-linejoin: round;
    stroke-width: 4px;
}

.graham-details {
    padding: 28px 4px 0;
    color: #344640;
    font-size: 12px;
}

.graham-details h2 {
    margin: 0 0 14px;
    color: #14211f;
    font-size: 16px;
    font-weight: 600;
}

.graham-step {
    min-height: 90px;
    margin: 0 0 18px;
    color: #14211f;
    font-size: 13px;
    line-height: 1.6;
}

.graham-details ul {
    margin: 0;
    padding-left: 20px;
}

.graham-details ul {
    display: grid;
    gap: 9px;
    padding: 0;
    list-style: none;
}

.graham-details ul li {
    display: flex;
    align-items: center;
    gap: 9px;
}

.graham-legend-marker {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 2px solid #344640;
    border-radius: 50%;
    background: #fff;
}

.graham-legend-marker.pivot {
    border-color: #536b22;
    background: #d8f36a;
}

.graham-legend-marker.stack {
    border-color: #29826a;
    background: #b9efc5;
}

.graham-legend-marker.candidate,
.graham-legend-marker.popped {
    border-color: #a63d2b;
    background: #f0745c;
}

.graham-orientation-note {
    margin: 18px 0 8px;
    color: #66716c;
    line-height: 1.5;
}

.geometry-page .controls-row textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

@media (max-width: 900px) {
    .geometry-page .container-row {
        min-height: 900px;
    }

    .geometry-visualization {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        min-width: 0;
        padding: 14px 18px;
    }

    .graham-details {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
        gap: 12px 20px;
        padding: 0 12px 20px;
    }

    .graham-details h2,
    .graham-step,
    .graham-orientation-note {
        grid-column: 1 / -1;
    }

    .graham-details h2 {
        margin-bottom: 0;
    }

    .graham-step {
        min-height: 0;
        margin: 0;
    }

    .graham-orientation-note {
        grid-row: 3;
        margin: 0;
    }

    .graham-details ul {
        grid-row: 4;
    }

}
