.ga-cross-head {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.ga-cross-head h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    line-height: 1.3;
}

.ga-cross-head p {
    max-width: 74ch;
    margin-top: .3rem;
    color: var(--text-secondary);
    font-size: .87rem;
}

.ga-cross-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: start;
    gap: clamp(1rem, 3vw, 2.25rem);
    padding-top: 1rem;
}

.ga-cross-matrix {
    min-width: 0;
    padding: .55rem .7rem .9rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fbfcfe;
}

.ga-pair-svg {
    display: block;
    width: min(100%, 32rem);
    height: auto;
    margin-inline: auto;
}

.ga-pair-axis {
    fill: #465a76;
    font: 700 10.5px var(--font-mono);
    pointer-events: none;
}

.ga-pair-cell {
    cursor: pointer;
    stroke: transparent;
    stroke-width: 1.5px;
    vector-effect: non-scaling-stroke;
}

.ga-pair-cell:hover {
    stroke: #826169;
}

.ga-pair-cell.ga-pair-selected {
    stroke: #201a31;
    stroke-width: 2px;
}

#gaPairLegend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .35rem .7rem;
    padding: .6rem .2rem .1rem;
    color: var(--text-secondary);
    font-size: .78rem;
}

.ga-pair-legend-label {
    font-weight: 700;
}

.ga-pair-legend-zero {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
}

.ga-pair-legend-zero > span:first-child {
    width: .7rem;
    height: .7rem;
    border: 1px solid #d9e2ef;
    border-radius: 3px;
}

.ga-pair-scale {
    display: grid;
    gap: .15rem;
    width: min(100%, 11.5rem);
}

.ga-pair-ramp {
    height: .5rem;
    border-radius: 4px;
}

.ga-pair-scale-labels {
    display: flex;
    justify-content: space-between;
    font: 600 .69rem var(--font-mono);
}

.ga-cross-inspector {
    min-width: 0;
}

#gaPairForm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto;
    align-items: end;
    gap: .5rem;
    margin-bottom: .95rem;
}

#gaPairForm label {
    display: grid;
    gap: .25rem;
    min-width: 0;
    color: var(--text-secondary);
    font-size: .8rem;
    font-weight: 700;
}

#gaPairForm select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: .35rem .5rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    text-overflow: ellipsis;
}

#gaPairForm .ga-action {
    min-height: 40px;
    white-space: nowrap;
}

#gaCrossTitle {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.3;
}

#gaCrossStatus {
    margin-top: .4rem;
    color: var(--text-secondary);
    font-size: .83rem;
}

#gaCrossStatus[data-kind="error"] {
    color: #9b2847;
}

#gaCrossRows:not(:empty) {
    margin-top: .5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow-x: auto;
}

.ga-cross-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: .84rem;
    line-height: 1.35;
    text-align: left;
}

.ga-cross-table th, .ga-cross-table td {
    padding: .55rem .65rem;
    border-bottom: 1px solid var(--border-color);
}

.ga-cross-table th {
    color: var(--text-secondary);
    background: var(--bg-secondary);
    font-size: .77rem;
    white-space: nowrap;
}

.ga-cross-table tbody tr:last-child td {
    border-bottom: 0;
}

.ga-cross-table :is(th, td):last-child {
    text-align: right;
}

.ga-cross-table td:last-child {
    font-family: var(--font-mono);
}

.ga-cross-table tbody tr:hover {
    background: #f3f7fe;
}

.ga-main .ga-cross-set {
    border: 0;
    padding: .14rem 0;
    background: transparent;
    color: #2459af;
    font: 700 .79rem var(--font-mono);
    white-space: nowrap;
    cursor: pointer;
}

.ga-cross-set:hover {
    text-decoration: underline;
}

#gaCrossPager {
    margin-bottom: 0;
}

#gaCrossPager .gc-page-range {
    display: block;
    font-size: .72rem;
    font-weight: 500;
}

@media (min-width: 901px) and (max-width: 1160px) {
    #gaPairForm {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ga-cross-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 540px) {
    #gaPairForm {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ga-cross-table th, .ga-cross-table td {
        padding-inline: .45rem;
    }
}
