* {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  max-width: 800px;
  margin: 48px 8px 8px;
}

nav {
  background-color: #eee;
  height: 32px;
  line-height: 32px;
  display: flex;
  flex-direction: row;
  border: 1px solid #444;
  border-top: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
}

@media (min-width: 800px) {
  nav {
    width: 800px;
    left: calc(50% - 400px);
  }
}

@media (min-width: 816px) {
  body {
    margin-left: auto;
    margin-right: auto;
  }
}

nav p.info .login-label {
  display: none;
}
nav p.info {
  margin: 0;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
  padding-left: 1em;
}
nav a, nav form {
  display: block;
  flex: 0 0 96px;
}
nav a, nav button {
  border: none;
  border-left: 1px solid #444;
  padding: 0;
  margin: 0;
  height: 31px;
  background-color: white;
  text-decoration: none;
  color: black;
  text-align: center;
}
nav a:hover, nav button:hover {
  background-color: #eee;
}
nav button {
  font: inherit;
  width: 100%;
}

@media (max-width: 600px) {
  nav {
    height: 80px;
    flex-wrap: wrap;
    border: none;
  }
  body {
    margin-top: 96px;
  }
  nav p.info {
    flex: 0 0 100%;
    height: 32px;
  }
  nav a, nav form {
    flex: 1 1 10%;
  }
  nav a, nav button {
    border: 1px solid #444;
    height: 48px;
    line-height: 48px;
  }
}

#events ul {
  padding: 0;
  border-top: 1px solid #aaa;
}
#events li {
  list-style-type: none;
  border-bottom: 1px solid #aaa;
}
#events li.past {
  opacity: 50%;
  background-color: #eee;
}
#events li.past>a>h2:before {
  content: "(past) ";
  font-size: 75%;
  vertical-align: 15%;
}
#events li>a {
  display: block;
  padding: 16px;
  text-decoration: none;
}
#events li.past>a {
  color: inherit;
}
#events li>a:hover {
  background-color: #eee;
}
#events li h2 {
  margin: 0;
}
p.time {
  color: #444;
  margin-bottom: 0;
  margin-top: 0.2em;
}
p.location {
  color: #444;
  margin-bottom: 0;
  margin-top: 0.2em;
}
p.location a {
  color: inherit;
}
p.error {
  background-color: #fcc;
  padding: 8px;
  border: 1px solid #c44;
}

#event {
  position: relative;
}
#event h1 {
  margin-bottom: 0;
}
#event p.edit {
  position: absolute;
  top: 0;
  right: 0;
}
#event p.description {
  margin: 1em 0;
  white-space: pre-wrap;
}
#event #details {
  border-bottom: 1px solid #444;
  margin-bottom: 1em;
}
#event #rsvp h2, #event #roster h2 {
  margin-top: 0;
}
input[type=text], input[type=tel], input[type=email], input[type=datetime-local] {
  display: block;
  width: 100%;
  max-width: 400px;
  border: 1px solid #ccc;
  background-color: #f8f8f8;
  border-radius: 3px;
  border-bottom: 1px solid #444;
  height: 2em;
}
textarea {
  display: block;
  width: 100%;
  border: 1px solid #ccc;
  background-color: #f8f8f8;
  border-radius: 3px;
  border-bottom: 1px solid #444;
  height: 10em;
  font-family: inherit;
}

@media (min-width: 600px) {
  #event #rsvp {
    float: right;
    width: 50%;
  }
  #event #roster {
    width: 50%;
  }
}

@media (max-width: 600px) {
  #event #rsvp p.coming label {
    display: inline-block;
    width: 160px;
    height: 48px;
    line-height: 48px;
  }
  input[type=text], input[type=tel], input[type=email] {
    height: 48px;
    font-size: 120%;
  }
  button {
    height: 48px;
    padding-left: 2em;
    padding-right: 2em;
  }
}

#event #roster ul {
  padding: 0;
}
#event #roster li {
  list-style-type: none;
  margin: 0.5em 0;
}
#event #roster li span.name {
  font-weight: bold;
}
#event #roster li p.comment {
  margin: 0 1em;
  font-size: 90%;
  color: #444;
}

label span.detail {
  font-size: 80%;
}

#users {
  border-collapse: collapse;
  width: 100vw;
  margin-left: -8px;
  min-width: 1000px;
}

@media (min-width: 800px) {
  #users {
    margin-left: calc(-50vw + 400px);
  }
}

#users tr {
  border-top: 1px solid #444;
}

#users td {
  padding: 1em;
}

#users td:nth-child(1) {
  width: 64px;
  padding-right: 0;
}

#users td.notes {
  white-space: pre-wrap;
  width: 240px;
  overflow: auto;
}

ul.group-chooser>li {
  list-style-type: none;
}
