
:root {
    color-scheme: light;
    font-family: Helvetica, Arial, sans-serif;
    color: #333;
    background: #fff;
}

/* Basic reset */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

h2 {
    margin: 18px 0 10px;
    color: #666;
    font-size: 1rem;
}

h3 {
    font-size: 0.875rem;
}

p {
    line-height: 1.45;
}

/* =========================
   Desktop layout
========================= */

.page-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 600px);
    gap: 20px;

    width: 960px;
    max-width: calc(100% - 40px);
    margin: 20px 0 0 20px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 20px;

    font-size: 1.5rem;
    color: #999;
}

.page-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

/* =========================
   IFRAME column
========================= */

.iframe-column {
    min-width: 0;
}

.app-iframe {
    display: block;
    width: 100%;
    height: 780px;
    border: 1px solid #999;
}

/* =========================
   Content column
========================= */

.content-column {
    min-width: 0;
}

/* =========================
   Distance table
========================= */

.responsive-table {
    width: 100%;
}

/* Each horizontal row */
.table-row {
    display: grid;
    gap: 4px;
    margin-bottom: 6px;

    /* Two shared tracks: headings and content */
    grid-template-rows: auto 1fr;
    align-items: stretch;
}

/* Three equal columns */
.row-three-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Two columns, first twice as wide */
.row-two-cols {
    grid-template-columns: 2fr 1fr;
}

/* Groups share the heading/content row tracks */
.table-group {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    min-width: 0;
}

/* Headings */
.group-heading {
    display: flex;
    align-items: center;

    padding: 4px 0;
    border-bottom: 1px solid #ccc;

    font-weight: bold;
    text-align: left;
}

/* Content cells */
.table-cell {
    padding: 4px 0;
    min-height: 0;
    text-align: left;
}

/* =========================
   Distance buttons
========================= */

.dist-button {
    display: block;
    width: 100%;
    margin: 0 0 5px;
    padding: 7px 9px;

    border: 1px solid #bbb;
    border-radius: 4px;
    background: #f7f7f7;

    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    text-align: left;

    cursor: pointer;
}

.dist-button:hover {
    background: #eaeaea;
}

.dist-button:focus-visible {
    outline: 2px solid #1769aa;
    outline-offset: 2px;
}

/* =========================
   Tablet layout
========================= */

@media (max-width: 767px) {
    .table-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 4px;
        margin-bottom: 6px;
    }

    .table-group {
        display: flex;
        flex-direction: column;
        grid-row: auto;
    }

    .group-heading {
        min-height: 0;
    }
}

/* =========================
   Mobile app / iframe view
========================= */

@media (max-width: 501px) {
    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .page-layout {
        display: block;
        width: 100%;
        max-width: none;
        height: 100dvh;
        margin: 0;
    }

    .content-column {
        display: none;
    }

    .iframe-column {
        width: 100%;
        height: 100%;
    }

    .app-iframe {
        width: 100%;
        height: 100%;
        border: none;
    }
}
