html,
body {
	height: 100%;
}

html {
	box-sizing: border-box;
}
*, *:before, *:after {
	box-sizing: inherit;
}

body {
	font-family: 'Roboto', sans-serif;
	font-size: 18px;
	line-height: 1.4;
	display: flex;
	flex-direction: column;
}

button {
	display: inline-block;
	border: none;
	border-radius: 3px;
	text-align: center;
	-webkit-appearance: none;
	cursor: pointer;
}

.wrapper {
	width: 90%;
	max-width: 800px;
	margin: 0 auto;
}

.actions,
.date-selector,
.timeline,
.add-entry {
	padding: 1em;
}

.actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 1em;
	background-color: #333;
	color: #fff;
}

.actions button,
.actions button:focus {
	flex: 1;
	padding: 0.3em 0.5em;
	border-radius: 0;
	background: none;
	color: inherit;
	font-size: 1.5em;
}

.actions button:hover {
	background-color: #eee;
	color: #333;
}

.actions button span {
	opacity: 0.5;
	display: inline-block;
	vertical-align: middle;
	font-size: 0.5em;
	font-weight: normal;
}

.actions button:hover span {
	opacity: 1;
}

button.undo,
button.undo:focus {
  flex: 0;
}

button.undo[disabled] {
  opacity: 0.25;
  pointer-events: none;
}

.date-selector {
	display: flex;
	align-items: center;
	padding: 0.4em 1em;
	border-bottom: 1px solid #eee;
	text-align: center;
}

.date-selector span,
.date-selector button {
	flex: 1;
}

.date-selector button,
.date-selector button:focus {
	padding: 0.5em 0.7em 0.6em;
	background: none;
}

.date-selector button:hover {
	box-shadow: inset 0 0 0 1px black;
}

.timeline {
	flex: 1;
	overflow-y: auto;
	padding-top: 0;
}

.entry {
  overflow: hidden;
	display: flex;
	justify-content: space-between;
	align-items: center;
  position: relative;
	max-height: 95%;
	margin-top: 1em;
	padding: 1em;
	border: 1px solid #ddd;
	border-radius: 3px;
	box-shadow: 0 0 50px rgb(0 0 0 / 0.1)
}

.entry .duration {
	display: block;
	text-align: right;
}

.entry h3 {
	display: inline-block;
	flex: 1;
	margin: 0;
	text-align: center;
	font-size: 1em;
}

.entry-null {
	opacity: 0.5;
	border-color: #eee;
	box-shadow: none;
}

.entry-null:hover {
	opacity: 1;
}

.entry-null h3 {
	font-weight: normal;
	font-size: 0.9em;
}

.entry-actions {
  display: none;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0 1em;
  background-color: rgba(255,255,255,0.99);
}

.entry:hover .entry-actions {
  display: flex;
}

.entry-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1px;
  background-color: #eee;
  text-align: center;
  font-size: 0.7em;
  line-height: 1;
}

.entry-action-group h5 {
  width: 100%;
  margin: 0;
  font-size: 0.8em;
  font-weight: normal;
  background-color: #fff;
}

.entry-action-group button {
  flex: 1;
  padding: 0.2em;
  border-radius: 0;
  background-color: #fff;
}

.entry-action-group button:hover {
  border-radius: 3px;
  background-color: transparent;
}

.add-entry {
	display: flex;
	flex-wrap: wrap;
	overflow-y: auto;
	max-height: 6.9em;
	padding-bottom: 0.3em;
	background-color: #eee;
	box-shadow: 0 -1px 0 rgb(0 0 0/ 0.2);
}

.add-entry button,
.add-entry button:focus {
	flex: 1 1 auto;
	min-width: 2.2em;
	padding: 0.5em;
	margin: 0 0.7em 0.7em 0;
	background-color: #fff;
	text-align: center;
	cursor: pointer;
}

.add-entry button:hover,
.add-entry button.active:hover {
	box-shadow: inset 0 0 0 2px black;
}

.add-entry button.active,
.entry.active {
	box-shadow: 0 0 50px rgb(0 0 0 / 10%), inset 0 0 0 1px black;
}

input[type="text"],
textarea,
select {
	display: block;
	width: 100%;
	padding: 1em;
	border: 1px solid #bbb;
	border-radius: 3px;
}

textarea {
	min-width: 100%;
	max-width: 100%;
	-moz-tab-size: 4;
		-o-tab-size: 4;
			 tab-size: 4;
}

input[type="submit"] {
	display: inline-block;
	padding: 0.5em 0.7em;
	border: 1px solid #bbb;
	border-radius: 3px;
	background-color: #eee;
	-webkit-appearance: none;
}


.modal {
	opacity: 0;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	transition: opacity 200ms;
}

.modal.open {
	opacity: 1;
	pointer-events: all;
}

.modal-background {
	opacity: 0.8;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #000;
}

.modal-box {
	position: absolute;
	top: 10%;
	left: 10%;
	width: 80%;
	height: 80%;
	border-radius: 5px;
	background-color: #fff;
}

.modal-close {
	position: absolute;
	top: -0.5em;
	right: -0.5em;
	padding: 0.2em 0.5em;
	border-radius: 50%;
	background-color: #666;
	color: #fff;
}

.modal-inner {
	overflow-y: auto;
	max-height: 100%;
	padding: 1em;
}

.modal-page {
	display: none;
}

.modal-page.active {
	display: block;
}

.modal-page > :first-child {
	margin-top: 0;
}

.modal-export {
  font-family: sans-serif;
}

.modal-edit-raw textarea {
	height: 55vh;
	max-height: calc(60vh - 5em);
	margin-bottom: 1em;
	font-size: 0.8em;
	font-family: monospace;
}
