.bsg-geometry {
    --bsg-accent: #18b8b2;
    --bsg-accent-soft: rgba(24, 184, 178, .1);
    --bsg-border: rgba(33, 43, 54, .14);
    --bsg-muted: #68737d;
    font-size: 15px;
    line-height: 1.45;
}

.bsg-geometry-set + .bsg-geometry-set {
    margin-top: 3rem;
}

.bsg-geometry-heading {
    margin-bottom: 1.25rem;
}

.bsg-geometry-heading h2 {
    margin: 0 0 .35rem;
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    line-height: 1.08;
}

.bsg-geometry-heading p {
    margin: 0;
    color: var(--bsg-muted);
}

.bsg-geometry-layout {
    display: grid;
    grid-template-columns: minmax(540px, 1.75fr) minmax(260px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.bsg-geometry-table-panel {
    min-width: 0;
}

.bsg-geometry-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border: 1px solid var(--bsg-border);
    -webkit-overflow-scrolling: touch;
}

.bsg-geometry-scroll:focus-visible,
.bsg-geometry-row:focus-visible {
    outline: 2px solid var(--bsg-accent);
    outline-offset: 2px;
}

.bsg-geometry-scroll-hint {
    display: none;
    margin: .55rem 0 0;
    color: var(--bsg-muted);
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
}

.bsg-geometry-table {
    width: 100%;
    min-width: 540px;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    font-size: 13.5px;
    line-height: 1.35;
}

.bsg-geometry-table th,
.bsg-geometry-table td {
    padding: .55rem .6rem;
    text-align: center;
    white-space: nowrap;
    border: 0;
    border-right: 1px solid var(--bsg-border);
    border-bottom: 1px solid var(--bsg-border);
    transition: color .16s ease, background-color .16s ease;
}

.bsg-geometry-table tr:last-child th,
.bsg-geometry-table tr:last-child td {
    border-bottom: 0;
}

.bsg-geometry-table th:last-child,
.bsg-geometry-table td:last-child {
    border-right: 0;
}

.bsg-geometry-table thead th {
    font-weight: 700;
    background: #f4f6f7;
}

.bsg-geometry-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 180px;
    text-align: left;
    white-space: normal;
    background: #fff;
}

.bsg-geometry-table thead th:first-child {
    z-index: 2;
    background: #f4f6f7;
}

.bsg-geometry-row {
    cursor: pointer;
}

.bsg-geometry-row:hover th,
.bsg-geometry-row:hover td,
.bsg-geometry-row.is-active th,
.bsg-geometry-row.is-active td {
    color: #087c78;
    background: var(--bsg-accent-soft);
}

.bsg-geometry-row.is-active th:first-child {
    box-shadow: inset 4px 0 0 var(--bsg-accent);
}

.bsg-geometry-unit {
    font-weight: 400;
    color: var(--bsg-muted);
}

.bsg-bike-panel {
    position: sticky;
    top: 1rem;
    margin: 0;
    padding: .875rem;
    border: 1px solid var(--bsg-border);
    background: #fafbfb;
}

.bsg-bike-svg {
    display: block;
    width: 100%;
    height: auto;
}

.bsg-bike-image {
    opacity: .62;
    pointer-events: none;
}

.bsg-bike-base circle,
.bsg-bike-base path,
.bsg-bike-base line {
    fill: none;
    stroke: #aeb5ba;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bsg-bike-base .bsg-ground {
    stroke-width: 2;
    stroke-dasharray: 5 7;
}

.bsg-measure {
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.bsg-measure.is-active {
    opacity: 1;
}

.bsg-measure line,
.bsg-measure path {
    fill: none;
    stroke: var(--bsg-accent);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bsg-measure .bsg-guide {
    marker-start: none;
    marker-end: none;
    opacity: .62;
    stroke-width: 2;
}

.bsg-arrow-head {
    fill: var(--bsg-accent);
}

.bsg-bike-panel figcaption {
    margin-top: .6rem;
    color: var(--bsg-muted);
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

@media (max-width: 1180px) {
    .bsg-geometry-layout {
        grid-template-columns: 1fr;
    }

    .bsg-bike-panel {
        position: static;
        width: min(100%, 500px);
        margin-inline: auto;
        grid-row: 1;
    }
}

@media (max-width: 767px) {
    .bsg-geometry {
        font-size: 14px;
        padding-bottom: max(5.5rem, env(safe-area-inset-bottom));
    }

    .bsg-geometry-heading h2 {
        font-size: clamp(1.75rem, 8vw, 2.25rem);
    }

    .bsg-geometry-layout {
        gap: 1.25rem;
    }

    .bsg-geometry-table {
        min-width: 520px;
        font-size: 13px;
    }

    .bsg-geometry-table th,
    .bsg-geometry-table td {
        padding: .48rem .5rem;
    }

    .bsg-geometry-table th:first-child {
        min-width: 160px;
    }

    .bsg-geometry-scroll-hint {
        display: block;
    }
}

@media (max-width: 480px) {
    .bsg-geometry-set + .bsg-geometry-set {
        margin-top: 2rem;
    }

    .bsg-geometry-heading {
        margin-bottom: 1rem;
    }

    .bsg-geometry-layout {
        gap: 1rem;
    }

    .bsg-geometry-table {
        min-width: 500px;
        font-size: 12.5px;
    }

    .bsg-geometry-table th,
    .bsg-geometry-table td {
        padding: .45rem;
    }

    .bsg-geometry-table th:first-child {
        min-width: 150px;
    }

    .bsg-bike-panel {
        padding: .65rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bsg-measure,
    .bsg-geometry-table th,
    .bsg-geometry-table td {
        transition: none;
    }
}
