html, body {
    padding: 0;
    margin: 0;
    height: 100%;
    min-width: 320px;
}

#mapDiv, #leftMapDiv, #rightMapDiv {
    padding: 0;
    margin: 0;
    height: 100%;
    width: 100%;
}

.mapContainer {
    position: relative;
    width: 100%;
    height: 100%;
}

.splitContainer {
    display: flex;
    width: 100%;
    height: 100%;
}

.splitContainer > #leftMapDiv,
.splitContainer > #rightMapDiv {
    flex: 1 1 50%;
    height: 100%;
}

.splitContainer > #rightMapDiv {
    border-left: 1px solid black;
}

.maintab {
    width: 100%; 
    height: calc(100% - var(--attribution-height, 32px));
    border-collapse: collapse;
    table-layout: fixed;
}

/* Palette shared with the RETROCHANGE project website. */
.toprow { height: 1px; }
.toprow > td { padding: 0; }
.siteHeader {
    --header-accent: #EB710F;
    --header-heading: #0D1228;
    --header-text: #565656;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand links" "subtitle area";
    align-items: center;
    gap: 10px 32px;
    padding: 14px 24px 16px;
    font-family: Arial, Helvetica, sans-serif;
    background: #F2E6D9;
    color: var(--header-heading);
    border-top: 4px solid var(--header-accent);
    border-bottom: 2px solid #C7AD93;
}
.headerBrand { grid-area: brand; display: flex; align-items: center; gap: 16px; min-width: 0; }
.maintitle { margin: 0; font-size: 32px; line-height: 1.15; color: var(--header-heading); font-weight: bold; letter-spacing: 0.02em; }
.subtitle { grid-area: subtitle; margin: 0; max-width: 1050px; font-size: 19.5px; font-weight: bold; line-height: 1.4; color: var(--header-text); }
.areaSelector { grid-area: area; display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-size: 19.5px; font-weight: bold; white-space: nowrap; }
.areaSelector select { box-sizing: border-box; width: 180px; min-height: 42px; padding: 7px 12px; border: 1px solid #D5D5D5; border-radius: 8px; background: #fff; color: var(--header-heading); font: inherit; max-width: 100%; cursor: pointer; }
.areaSelector select:disabled { cursor: wait; }
.areaSelector select:focus-visible, .headerLinks a:focus-visible { outline: 2px solid var(--header-accent); outline-offset: 3px; }
.layerStatus {
    position: absolute;
    bottom: 64px;
    left: 12px;
    right: 12px;
    padding: 10px;
    background: #fff4ce;
    color: #563b00;
    z-index: 110;
}

.logotuzvo { box-sizing: border-box; width: 100px; height: 56px; object-fit: contain; padding: 5px; background: #fff; border: 1px solid #D5D5D5; border-radius: 10px; }
.headerLinks { grid-area: links; justify-self: end; }
.linktab { width: auto; border-collapse: collapse; }
.linkpanel { text-align: right; padding: 4px 0 4px 20px; font-size: 14px; }
.linkpanel:first-child { padding-left: 0; }
.headerLinks a { color: var(--header-heading); text-decoration: none; line-height: 1.5; }
.headerLinks a:hover { color: var(--header-accent); text-decoration: underline; }
@media (max-width: 1100px) {
    .siteHeader { grid-template-areas: "brand links" "subtitle subtitle" "area area"; gap: 12px 24px; }
    .areaSelector { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .siteHeader .headerBrand { gap: 10px; }
    .siteHeader .maintitle { font-size: 22px; }
    .siteHeader .headerBrand .logotuzvo { width: 64px; height: 40px; }
}
.legendPanel {
    position: absolute;
    top: 72px;
    right: 12px;
    width: 220px;
    background-color: white;
    padding: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    border-radius: 4px;
    display: block;
    z-index: 100;
}

.legendSectionTitle {
    margin: 8px 0 4px 0;
    padding-bottom: 2px;
    border-bottom: 1px solid #d4d4d4;
    color: #2f4f2f;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.legendSectionTitle:first-child {
    margin-top: 0;
}

.legendBasemapSelect {
    margin: 4px 0 8px 0;
}

.legendBasemapSelect select {
    width: 100%;
    box-sizing: border-box;
    font-size: small;
    padding: 3px 4px;
}

.legendItem {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin: 2px 0;
}

.legendItem label {
    font-size: small;
    line-height: 1.25;
}

.legendLeftPanel {
    left: 12px;
    right: auto;
    max-height: calc(100% - 110px);
    overflow: auto;
}

.legendRightPanel {
    right: 12px;
    left: auto;
    max-height: calc(100% - 110px);
    overflow: auto;
}

.leftLegendPanel {
    position: absolute;
    float: left;
    top: 92px;
    left: 2px;
    width: 220px;
    background-color: White;
    padding-right: 10px;
    padding-bottom: 4px;
    display: block;
    z-index: 100;
}

.logoPanel
{
    position: absolute;
    float: left;
    bottom: 26px;
    left: 2px;
    display: none;
    z-index: 100;
}

.logoefrr
{
    float: left;
    width: 120px;
    height: 110px;
    clear: both;
    margin-bottom: 4px;
    margin-left: 2px;
}

.logoopvav
{
    float: left;
    width: 120px;
    height: 120px;
    clear: both;
    margin-left: 2px;
}

.contactPanel {
    position: absolute;
    float: left;
    bottom: calc(var(--attribution-height, 32px) + 6px);
    left: 2px;
    z-index: 100;
}

.projectLogoImg {
    display: block;
    width: 120px;
    height: auto;
    margin-bottom: 6px;
    margin-left: 6px;
    border-radius: 6px;
}

.contactImg {
    float: left;
    width: 180px;
    height: auto;
    opacity: 0.75;
    clear: both;
}

p.slogan {
    font-size: small;
    background: white;
    opacity: 0.7;
    float: left;
    clear: both;
    margin-top: 4px;
    margin-bottom: 4px;
    margin-left: 2px;
}

.attributionPanel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 5px 12px;
    background: #FFFFFE;
    border-top: 1px solid #D5D5D5;
    box-sizing: border-box;
    text-align: center;
}

.attributionPanel p {
    float: none;
    clear: none;
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 2px;
    text-align: center;
    margin: 0;
    opacity: 1;
    font-size: 11px;
    line-height: 1.4;
    color: #565656;
}

.attributionPanel a { color: #0D1228; }

.mapinfoPanel {
    position: fixed;
    bottom: calc(var(--attribution-height, 32px) + 10px);
    right: 10px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: auto;
    padding: 4px 6px;
    background-color: white;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.scalebarPanel {
    position: relative;
    width: 200px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.coordinatesPanel {
    position: relative;
    width: 200px;
    z-index: 100;
}

.coordinatesPanel p {
    font-size: small;
    padding-left: 4px;
    padding-right: 4px;
    text-align: left;
    margin-top: 0px;
    margin-bottom: 0px;
}

.anchorIcon {
    background-image: url(img/anchor.png);
    width: 16px;
    height: 16px;
}

.zoominIcon {
    background-image: url(img/nav_zoomin.png);
    width: 16px;
    height: 16px;
}

.zoomoutIcon {
    background-image: url(img/nav_zoomout.png);
    width: 16px;
    height: 16px;
}

.zoomfullextIcon {
    background-image: url(img/nav_fullextent.png);
    width: 16px;
    height: 16px;
}

.zoomprevIcon {
    background-image: url(img/nav_previous.png);
    width: 16px;
    height: 16px;
}

.zoomnextIcon {
    background-image: url(img/nav_next.png);
    width: 16px;
    height: 16px;
}

.panIcon {
    background-image: url(img/nav_pan.png);
    width: 16px;
    height: 16px;
}

.swipeIcon {
    background-image: url(img/nav_swipe.png);
    width: 16px;
    height: 16px;
}

.viewMapIcon {
    background-image: url(img/view_map.png);
    width: 16px;
    height: 16px;
}

.viewSwipeIcon {
    background-image: url(img/view_swipe.png);
    width: 16px;
    height: 16px;
}

.viewTileIcon {
    background-image: url(img/view_tile.png);
    width: 16px;
    height: 16px;
}

.linkIcon {
    background-image: url(img/nav_link.png);
    width: 16px;
    height: 16px;
}

.facebookIcon {
    background-image: url(img/facebook16.png);
    width: 16px;
    height: 16px;
}

.cnamesIcon {
    background-image: url(img/view_flagy.png);
    width: 16px;
    height: 16px;
}

.epochIcon {
    background-image: url(img/view_epoch.png);
    width: 16px;
    height: 16px;
}

.eulogoIcon {
    background-image: url(img/nav_eulogo.png);
    width: 16px;
    height: 16px;
}

.legend1Icon {
    background-image: url(img/nav_legend1.png);
    width: 16px;
    height: 16px;
}

.actionBar {
    position: absolute;
    top: 6px;
    right: 12px;
    z-index: 110;
    display: block;
    background: var(--calcite-color-foreground-1, #fff);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    overflow: hidden;
}

.esri-ui .esri-attribution { z-index: 120; }

.measurementPanel {
    position: absolute;
    right: 12px;
    width: 220px;
    min-height: 40px;
    background-color: white;
    padding: 4px 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    border-radius: 3px;
    z-index: 100;
    display: none;
}

.bookLinkIcon {
    background-image: url(img/book_link.png);
    width: 16px;
    height: 16px;
}

@media (max-width: 700px) {
    .siteHeader { grid-template-columns: minmax(0, 1fr); grid-template-areas: "brand" "subtitle" "area" "links"; padding: 12px 16px; }
    .headerLinks { justify-self: start; width: 100%; }
    .linktab { width: 100%; }
    .siteHeader .linkpanel { padding: 4px 8px 4px 0; text-align: left; font-size: 12px; }
    .siteHeader .logotuzvo { width: 80px; height: 46px; }
    .areaSelector { flex-wrap: wrap; white-space: normal; }
    .maintitle {
        font-size: 26px;
    }

    .subtitle {
        font-size: 18px;
    }

    .areaSelector {
        font-size: 18px;
    }

    .actionBar { left: 8px; right: 8px; overflow-x: auto; }

    .legendPanel {
        top: 64px;
        width: 200px;
        max-height: calc(100% - 140px);
        overflow: auto;
    }

    .legendLeftPanel {
        left: 8px;
    }

    .legendRightPanel {
        right: 8px;
    }

    .measurementPanel {
        right: 8px;
        width: 210px;
    }

    .attributionPanel {
        display: block;
        left: 0;
        right: 0;
        bottom: 0;
        text-align: center;
    }

    .attributionPanel p {
        display: inline-block;
        max-width: 100%;
        font-size: xx-small;
        line-height: 1.2;
        text-align: center;
    }

    .mapinfoPanel {
        right: 8px;
        bottom: calc(var(--attribution-height, 32px) + 8px);
    }
}
