html {
  font-size: 10px;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-size: 16px;
  background: #f7f7f2;
  color: #333;
  font-family: "Calibri", arial, sans-serif;
}
@media screen and ((max-width: 768px) or ((max-height: 600px) and (orientation: landscape)) or ((min-width: 601px) and (max-width: 1024px) and (orientation: portrait))) and (hover: none) {
  body {
    font-size: 1.4rem;
  }
}

/* Generic Element Styles */
a {
  text-decoration: none;
  color: #365d98;
}
a:hover, a:active {
  color: #7592bd;
}

a.external:after,
.external a:after {
  content: " " url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);
}

/* Top-Level Layout */
#canvas {
  display: grid;
  column-gap: 0;
  row-gap: 0;
  grid-template-columns: 320px auto;
  height: 100%;
}

#controlsContainer {
  position: relative;
  grid-column-start: 1;
  grid-column-end: 2;
  z-index: 100;
}

#mapContainer {
  position: relative;
  grid-column-start: 2;
  grid-column-end: 3;
}
#mapContainer #map {
  width: 100%;
  height: 100%;
}

#detailsOverlay {
  display: none;
}

/*  Generic Classes */
.hidden {
  display: none;
}

/* main body container */
/* control box */
#controlsContainer {
  box-shadow: 3px 0px 5px -2px #555;
  overflow-y: auto;
}

.button-bar {
  display: flex;
  border: 2px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-left: 8px;
  margin-right: 8px;
  margin-top: 12px;
}
.button-bar.hidden {
  display: none;
}
.button-bar .button {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: #fff;
  color: #333;
  cursor: auto;
  font-size: 1em;
  text-transform: uppercase;
  transition: background-color 0.3s, color 0.3s;
}
.button-bar .button.active {
  background-color: #f05c2d;
  color: #fff;
}
.button-bar .button:not(.active) {
  cursor: pointer;
}
.button-bar .button:not(.active):hover {
  background-color: #ddd;
  /* TODO: make this a little more interesting */
}

/* bill selection list */
#billsList {
  list-style-type: none;
  padding-left: 0;
}
#billsList .billCategoryLabel,
#billsList .bill-label {
  all: unset;
  cursor: pointer;
}
#billsList .billCategoryList {
  border-top: 2px solid #a9bbd6;
}
#billsList .billCategoryList:last-child {
  border-bottom: 2px solid #a9bbd6;
}
#billsList .billCategoryList .billCategoryLabel {
  padding: 6px;
  font-size: 1.2em;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 300ms;
}
#billsList .billCategoryList .billCategoryLabel:hover {
  background: #dde4ef;
  color: inherit;
}
#billsList .billCategoryList .billCategoryLabel > span {
  margin-left: 10px;
}
#billsList .billCategoryList .billCategoryLabel img {
  flex: 0 0 auto;
  width: 1.5em;
  height: 1.5em;
  transition: transform 300ms ease-in-out;
}
#billsList .billCategoryList.active .billCategoryLabel {
  border-bottom: 2px solid #a9bbd6;
}
#billsList .billCategoryList.active .billCategoryLabel img {
  transform: rotate(-180deg);
}
#billsList .bills-sublist {
  border-style: solid;
  border-color: #b6b6b6;
  border-width: 0 1px;
  background: #e9e9ed;
  padding-left: 0;
}
#billsList .bills-sublist .bill-item {
  list-style: none;
  padding: 8px 10px 8px 30px;
  transition: background-color 300ms;
}
#billsList .bills-sublist .bill-item:not(:last-child) {
  border-bottom: 1px solid #b6b6b6;
}
#billsList .bills-sublist .bill-item.active {
  background: #ff916f;
  font-weight: 700;
  pointer-events: none;
}
#billsList .bills-sublist .bill-item:not(.active):hover {
  cursor: pointer;
  background: #ffdfd6;
}
#billsList .bills-sublist .bill-label {
  font-size: 1em;
}
#billsList .bills-sublist .bill-label:hover {
  color: inherit;
}

/* house level selectors */
#layerControls {
  width: 90%;
  margin: 0 auto;
  background: #f7f7f2;
  margin-top: 20px;
}
#layerControls .layer-controls-label {
  font-weight: 700;
  padding-bottom: 4px;
  text-align: center;
}
#layerControls #layersList {
  display: flex;
  flex-wrap: wrap;
}
#layerControls #layersList .layer-toggle-item {
  text-align: center;
  width: 50%;
  margin: 12px 0;
}
#layerControls .btnLayerToggle {
  text-align: center;
  border: 1px solid #999;
  background-color: #fff;
  box-shadow: 0 3px 5px -2px;
  font-size: 1.2rem;
  color: #333;
  padding: 8px 16px;
  border-radius: 100px;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}
#layerControls .btnLayerToggle.active {
  background-color: #f05c2d;
  border-color: #333;
  color: #fff;
  box-shadow: 0 3px 5px -2px #333;
}
#layerControls .btnLayerToggle.active:hover {
  cursor: default;
}
#layerControls .btnLayerToggle:not(.active):hover {
  background: #ddd;
  color: #333;
}

/* special mini map controls */
#canvas.mini {
  display: block;
}
#canvas.mini #controlsContainer {
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(247, 247, 242, 0.5);
  backdrop-filter: blur(2px);
  box-shadow: 3px 3px 5px -2px #555;
}
#canvas.mini #controlsContainer #layerControls.active {
  width: auto;
  margin: 10px;
  background: transparent;
}
#canvas.mini #controlsContainer #layerControls.active #layersList {
  flex-direction: column;
  flex-wrap: nowrap;
}
#canvas.mini #controlsContainer #layerControls .layer-toggle-item {
  width: 100%;
  margin: 16px 0;
}

#mobileControlsActivator {
  display: none;
}

/* mapbox overrides */
.mapboxgl-canvas-container {
  cursor: default !important;
}

.mapboxgl-ctrl-logo {
  display: none !important;
}

.mapboxgl-ctrl-top-right {
  top: 30px;
}

/* "Loading..." shield */
#shield {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  background: rgba(44, 44, 44, 0.9);
  color: #f7f7f2;
}
#shield.active {
  display: table;
}
#shield .shieldMsg {
  display: table-cell;
  width: 300px;
  height: 300px;
  margin: auto;
  vertical-align: middle;
  text-align: center;
}
#shield .shieldMsg img {
  margin: auto;
}

.tally-popup .mapboxgl-popup-content {
  background: #f7f7f2;
  color: #333;
}
.tally-popup.mapboxgl-popup-anchor-top .mapboxgl-popup-tip, .tally-popup.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip, .tally-popup.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
  border-bottom-color: #f7f7f2;
}
.tally-popup.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip, .tally-popup.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip, .tally-popup.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
  border-top-color: #f7f7f2;
}
.tally-popup.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
  border-right-color: #f7f7f2;
}
.tally-popup.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
  border-left-color: #f7f7f2;
}

/* "Random Mode" notification text */
#randomNotice {
  background: #f7f7f2;
  text-align: center;
  z-index: 99;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}

.details {
  font-size: 1.6rem;
  margin: 0;
}
.details .detailsContent {
  padding: 0 8px;
}
.details .detailsContent .billTitle {
  font-size: 2rem;
  margin: 4px 12px 8px 0;
}
.details .detailsContent .billDescription {
  clear: both;
  font-size: 1.3rem;
  margin: 0 8px 8px 0;
}
.details .detailsContent .billLinks ul {
  font-size: 1.4rem;
  margin: 0;
  padding: 0;
  list-style-type: none;
}
.details .detailsContent .billLinks ul a {
  display: block;
  padding-left: 22px;
  line-height: 22px;
}
.details .detailsContent .billLinks ul a img {
  width: 16px;
  height: 16px;
}

/* tally stats box on top right of map */
#tallyStats {
  display: none;
  font-size: 10px;
  color: #f7f7f2;
  background: #333;
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 0 0 0 5px;
  padding: 4px;
}
#tallyStats .tallyStatsItemLabel::after {
  content: ":";
}

.talliesCounts {
  clear: both;
  width: 100%;
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.talliesCounts caption {
  text-align: left;
  font-size: 1.6rem;
  padding-bottom: 2px;
}
.talliesCounts th,
.talliesCounts td {
  min-width: 2em;
}
.talliesCounts th {
  text-align: left;
  padding-right: 8px;
}
.talliesCounts td {
  text-align: right;
  padding-left: 4px;
}
.talliesCounts .talliesPieChart {
  margin: auto;
  height: 50px;
  width: 50px;
  border-radius: 50%;
  border: 1px solid #89a2a6;
}

/* expandableText */
/* expanded/collapsed states */
.extExpanded {
  display: inline;
}
.extExpanded.extTrailer {
  display: none;
}

.extCollapsed {
  display: none;
}
.extCollapsed.extTrailer {
  display: inline;
}

/* MOBILE STYLES */
@media screen and ((max-width: 768px) or ((max-height: 600px) and (orientation: landscape)) or ((min-width: 601px) and (max-width: 1024px) and (orientation: portrait))) and (hover: none) {
  /* (hover:none), (hover:on-demand), (pointer:coarse) { */
  #canvas {
    display: block;
    grid-template-columns: auto 40vh;
  }
  #canvas.mini #controlsContainer {
    top: 0;
    bottom: auto;
    backdrop-filter: none;
  }
  #canvas.mini #controlsContainer #layerControls.active #layersList {
    flex-direction: row;
  }
  /* transitions */
  .tstandard {
    -webkit-transition: all 300ms ease-in-out;
    transition: all 300ms ease-in-out;
  }
  .tlong {
    -webkit-transition: all 600ms ease-in-out;
    transition: all 600ms ease-in-out;
  }
  #mobileControlsActivator {
    pointer-events: none;
    display: initial;
    position: fixed;
    top: 0;
    width: 100vw;
    height: 50px;
    margin: 0;
    padding-bottom: 8px;
  }
  #mobileControlsActivator.active {
    top: 40vh;
    pointer-events: auto;
  }
  #mobileControlsActivator .drawerHandle {
    display: block;
    width: 75px;
    height: 40px;
    margin: 0 auto;
    text-align: center;
    border-radius: 0 0 50% 50%;
    text-indent: -1000px;
    background: rgba(247, 247, 242, 0.85);
    pointer-events: auto;
  }
  #mobileControlsActivator .drawerHandle .drawerIcon {
    width: 100%;
    height: 100%;
    /* make sure width/height match .drawerHandle dimensions */
    background: url("data:image/svg+xml;utf8,<svg viewBox='0 0 130 110' width='75' height='40' xmlns='http://www.w3.org/2000/svg'><g><path d='m121.3,34.6c-1.6-1.6-4.2-1.6-5.8,0l-51,51.1-51.1-51.1c-1.6-1.6-4.2-1.6-5.8,0-1.6,1.6-1.6,4.2 0,5.8l53.9,53.9c0.8,0.8 1.8,1.2 2.9,1.2 1,0 2.1-0.4 2.9-1.2l53.9-53.9c1.7-1.6 1.7-4.2 0.1-5.8z' fill='black'/></g></svg>") center center no-repeat;
    transition: transform 600ms ease-in-out;
    -webkit-transition: -webkit-transform 600ms ease-in-out;
    -moz-transition: -moz-transform 600ms ease-in-out;
  }
  #mobileControlsActivator .drawerHandle.active .drawerIcon {
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
  }
  #mobileControlsActivator .drawerHandle span {
    display: none;
  }
  .drawer {
    background-color: rgba(247, 247, 242, 0.85);
    position: fixed;
    top: -40vh;
    left: 0;
    z-index: 100;
    width: 100vw;
    height: 40vh;
    max-height: 40vh;
    transition: all 600ms ease-in-out;
    overflow-y: auto;
  }
  .drawer.active {
    top: 0;
  }
  #detailsOverlay {
    position: fixed;
    bottom: -35vh;
    left: 0;
    z-index: 101;
    display: block;
    width: 100vw;
    height: 35vh;
    overflow-y: auto;
    max-height: 35vh;
    overflow-y: auto;
    background: rgba(44, 44, 44, 0.9);
    color: #f7f7f2;
    transition: all 600ms ease-in-out;
  }
  #detailsOverlay.active {
    bottom: 0;
  }
  #detailsOverlay .details-close .close-icon {
    position: absolute;
    top: 1vh;
    right: 2vw;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 16 16'><g><path d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z' fill='white'/></g></svg>") center center no-repeat;
    height: 3vh;
    width: 3vh;
    transition: transform 300ms ease-in-out;
  }
  #detailsOverlay .details-close span {
    display: none;
  }
  .details .detailsContent {
    padding: 24px 24px 0 24px;
  }
  .details .detailsContent .talliesCounts caption {
    text-align: left;
  }
  .details .detailsContent .billDescription {
    margin: 16px;
  }
  .details .detailsContent .billLinks ul li {
    display: block;
    text-align: center;
    margin-bottom: 16px;
  }
  .details .detailsContent .billLinks ul li a {
    font-size: 1.1em;
    line-height: 2.5em;
    height: 2.5em;
    border: 1px solid #f05c2d;
    border-radius: 30px;
    padding-left: 0;
  }
  .details .detailsContent .billLinks ul li a:active {
    border: 1px solid #ff916f;
  }
  .details .detailsContent .billLinks ul li a:after {
    content: none;
  }
  .details .detailsContent a {
    text-decoration: none;
    color: #f05c2d;
  }
  .details .detailsContent a:active {
    color: hsl(14, 87%, 76%);
  }
  table {
    color: #f7f7f2;
  }
}
