#map { width: 100%; height: 100%; flex: 1; grid-area: map;}

#map-container { 
    display: grid; 
    grid-template-areas: 
    "nav sidebar"
    "map sidebar";
  grid-template-columns: 1fr min-content; /* Sidebar width, content takes the rest */
  grid-template-rows: min-content 1fr; /* Nav height, rest fills space */
  /* height: 100vh; Full viewport height */
    height: 100%; 
}

h2 {
    margin: 0.25em 0;
}

#measureselect {
    grid-area: nav;
    background-color: var(--concrete);
    color: var(--parchment);
}

.categorybar, .measurebar {
    width: calc(100% - 10px);
}

.categorybar {
    padding: 0px 5px;
    border-top: 2px solid var(--concrete);
    background-color: var(--charcoal);
    color: var(--parchment);
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(auto-fill, minmax(fit-content , 1fr));
    gap: 0px;
    border-bottom: none;
    /* grid-template-rows: 100%; */
}
#measureselect .categorybar button {
    padding-top: 3px;
    height: 100%;
    background-color: var(--charcoal);
    color: var(--parchment);
}
#measureselect .categorybar button:hover {
    background-color: var(--forest-green) !important; 
    filter: brightness(100%);
}
#measureselect .categorybar button[autofocus] {
    border-bottom: 3px solid var(--sea-foam);
    background-color: var(--charcoal);
}

#measureselect .measurebar {
    display: grid;
    padding: 5px;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 1px;
    border-bottom: 2px solid var(--charcoal);
    background-color: var(--light-charcoal);
    gap: 3px;
}

#measureselect button {
    opacity: 1;
    border: none;
    background-color: var(--light-charcoal);
}

#measureselect .measurebar button {
    background-color: var(--concrete);
    /* border: 1px solid var(--light-charcoal); */
}

#measureselect button:hover {
    filter: brightness(85%);
}
#measureselect button:active {
    filter: brightness(100%);
}

#measureselect button[autofocus] {
    background-color: var(--sea-foam);
}

/* .container {
    width: 95%;
} */

.measure {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 3px;
    margin-left: -5px;
    padding: 0px 5px;
    background: var(--warm-cloud);
    width: 100%;
    list-style: none;
}

.measure::-webkit-details-marker {
  display: none;
}

.name {
    margin: auto 0px;
    padding: 4px 0px;
    border: none;
    background-color: inherit;
}

.priority {
    font-weight: bold;
}

#sidebar {
    grid-area: sidebar;
    padding: 16px; 
    background: var(--parchment); 
    overflow-y: auto;
    width: 370px;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: none;
    box-shadow: 3px 0px 3px -2px gray inset;
}

.blurb {
    font-size: small;
    /* width: 95%; */
    margin: 0.5em
}

.category-header {
    font-size: large;
    font-weight: bold;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
}

summary {
    padding: 0.25em 0;
    cursor: pointer;
    font-weight: bold;
}
summary:hover {
  filter: brightness(0.8);
}

.container {
    border: 1px solid var(--wool);
    border-left: 3px solid var(--wool);
}

.category-group, .container {
    border-radius: 3px;
    border-left: 3px solid var(--wool);
    margin-bottom: 0.5em;
    padding: 0 5px;
    background-color: var(--warm-cloud);
    width: calc(100% - 10px);
}

/* .category-header {
    padding-left: 5px;
} */

.value {
    padding: 0.2em;
    display: inline-block;
    text-align: right;
    margin-top: auto;
    margin-bottom: auto;
    font-weight: normal;
    font-size: initial;
}

.container>div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.focus {
    border-width: 3px;
    background-color: var(--sea-foam);
    border-color: var(--forest-green);
}

.detail {
    visibility: hidden;
    height: 0px;
}
.focus + .detail {
    visibility: visible !important;
    height: fit-content !important;
}

.download{
    margin-left: auto;
    margin-right: auto;
    height: fit-content;
    width: fit-content;
    padding: 0.5em;
    background-color: var(--concrete);
}
.download a {
    padding: 0.5em;
    color: black;
    text-decoration: none;
    margin-bottom: 5px;
}

.download a:visited {
    color: var(--violet);
}
.download a:active {
    color: var(--violet);
}


.legend {
  background: white;
  padding: 10px;
  font-family: sans-serif;
  font-size: 12px;
  position: absolute;
  bottom: 30px;
  left: 10px;
  z-index: 1;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}
.legend h4 {
  margin: 0 0 5px;
}
.legend div {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.legend span {
  display: inline-block;
  width: 20px;
  height: 10px;
  margin-right: 8px;
}

.container[open]>.measure>.value {
    visibility: hidden;
    height: 1.125em;
}

.container[open]>.measure>.value>.priority {
    height: 1.125em;
    visibility: visible;
}

.lr {
    display: flex;
    flex-direction: row;
    margin-left: auto;
    margin-right: auto;
}

/* .lr:first-child{
    margin-left: auto;
}

.lr:last-child{
    margin-right: auto;
} */