/* Colors */
:root {
	--neg: #c50000;
	--pos: #25c500;
	--base: #b0b0b0;
	--hover: #ededed;
	--default: #ffffff;
	--tap: rgba(176, 176, 176, .5);
}
html {
	touch-action: pan-y;
}
body, input, select, button {
	font: 18px/18px arial, sans-serif;
}
button, input[type="button"], *[role="button"] {
	cursor: pointer;
}
body {
	margin: 1.4em;
	color: #000;
}
select {
	appearance: none;
	background: url("icons.svg#arrow") right .4em center / .48em .48em no-repeat;
}
input, select, button {
	/* Reset, mainly for iOS */
	-moz-appearance: none;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
}
body #content select {
	padding-right: 1.35em;
}
body.show-cover {
	overflow: hidden;
}
body:not(.tabbing) .day-modal-row, body:not(.tabbing) td[role="button"], tr[role="button"], select, button, input {
	outline: none;
}
table {
	border-spacing: 0;
	border-collapse: collapse;
}
#month_container > table {
	width: 100%;
}
th {
	padding-bottom: .3em;
}
td {
	padding: .1667em 0 0 0;
}
button {
	font-size: .722em;
	border: 0;
	padding: 0;
	opacity: .6;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: center;
}
button:hover, button:focus {
	opacity: 1;
}
button:disabled {
	cursor: default;
	opacity: .6;
}
input[type="button"] {
	background-position: center;
	background-repeat: no-repeat;
}
.pwa {
	-webkit-touch-callout: none; /* iOS Safari */
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
#cover {
	display: none;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	position: fixed;
	z-index: 1;
	text-align: center;
	overflow-y: auto;
}
.show-cover #cover {
	display: block;
}
.show-cover #content {
	opacity: .40;
}
#content {
	width: 13em;
	margin: 0 auto;
}
.show-load #main_loader, .show-modal #modal {
	display: inline-block;
}
#main_loader {
	display: none;
	margin-top: 8.8em;
	width: 2.66em;
	height: 2.66em;
}
#modal {
	display: none;
	position: relative;
	margin-top: 12vh;
	margin-bottom: 1.5em;
	min-width: 8em;
	min-height: 5em;
	box-shadow: .15em .15em rgba(0,0,0,.2);
}
.modal-loading #modal_content, .modal-loading .close-btn {
	display: none;
}
.modal-loading #modal_loader {
	display: block;
	margin: 1.4em auto 0 auto;
}
#modal_loader {
	width: 2.1em;
	height: 2.1em;
	display: none;
}
.spin {
	animation: spin .45s linear infinite;
}
@keyframes spin {
	from {
		transform: rotate(0deg);
	} to {
		transform: rotate(360deg);
	}
}
#dropdown_container {
	height: 1.888em;
	margin-bottom: .85em;
	text-align: right;
}
#dropdown_container .frame {
	height: 100%;
	display: inline;
	vertical-align: top;
}
#dropdown {
	/* padding: 0 .25em; */
	padding-top: 0;
	padding-bottom: 0;
	width: calc(100% - 2.238em);
}
option {
	padding: 0;
	margin: 0;
}
#refresh_button {
	background-image: url("icons.svg#refresh");
	background-size: 63% 59.2%;
	padding: 0;
	width: 1.888em;
	margin-left: .35em;
}
.hidden {
	display: none;
}
.breaker {
	height: .3em;
}
.frame.filled {
	background-image: linear-gradient(to right, transparent 0%, transparent 55%, var(--pos) 620%);
}
.negative.frame.filled {
	background-image: linear-gradient(to right, transparent 0%, transparent 55%, var(--neg) 620%);
}
.open-row td .frame, .day-breakdown-row .frame {
	border-left: .222em solid var(--base);
	padding-left: .222em;
}
.open-row td {
	padding-bottom: 0;
}
.day-breakdown-row td {
	padding-top: 0;
}
.day-breakdown-row .frame {
	border-top: 0;
}
.day-row .time {
	float: right;
}
.day-of-week {
	font-size: .8em;
	line-height: .8em;
	color: var(--base);
	margin-left: .2em;
}
select:focus,
select:hover,
input[type="button"]:focus,
input[type="button"]:hover,
.add-panel .add-btn:focus:not(:disabled),
.add-panel .add-btn:hover:not(:disabled) {
	background-color: var(--hover);
}
tr[role="button"]:hover .frame,
tr[role="button"]:focus .frame {
	background: var(--hover);
}
.summary-line {
	border: none;
}
.summary-line .frame {
	border-color: transparent;
	background: none;
}
.summary-line .time {
	float: right;
	font-size: 1.2em;
	font-style: italic;
}
.frame {
	border: .0555em solid var(--base);
	background-color: var(--default);
	display: block;
	padding: .3888em;
}
.empty-month-text {
	font-size: .9em;
	margin-top: 2em;
	text-align: center;
	line-height: 1.227em;
}
.from-to {
	float: left;
	font-size: .9em;
}
.day-breakdown-row .time {
	float: right;
	font-size: .9em;
}
.day-breakdown-row .frame {
	line-height: 1.3em;
	padding-top: .3em;
	padding-bottom: .3em;
}
.time {
	color: var(--pos);
}
.negative.time, .negative .time {
	color: var(--neg);
}
.left {
	text-align: left;
}
.right {
	text-align: right;
}
.see-more-btn {
	background-image: url("icons.svg#more");
	background-size: 66% 27.5%;
	width: 2.35em;
	height: 1.4em;
	float: right;
}
.add-btn {
	background-image: url("icons.svg#add");
	background-size: 70% 70%;
	height: 1.554em;
	width: 1.554em;
}
.remove-btn {
	background-image: url("icons.svg#bin");
	background-size: 83% 83%;
	height: 1.554em;
	width: 1.554em;
}
.close-btn {
	background-image: url("icons.svg#close");
	background-size: 85%;
	width: 1.6em;
	height: 1.6em;
	position: absolute;
	top: .7em;
	right: .7em;
}
.ok-btn {
	background-image: url("icons.svg#ok");
	background-size: 83% auto;
	height: 1.554em;
	width: 1.554em;
}
.cancel-btn {
	background-image: url("icons.svg#cancel");
	background-size: 70% 70%;
	height: 1.554em;
	width: 1.554em;
}
.add-panel .add-btn {
	width: 100%;
	background-size: auto 70%;
	padding: .111em 0;
}
#add_row td {
	padding-top: .8em;
	padding-bottom: .2em;
}
#add_row .record-cell {
	padding-left: .9em;
}
.day-modal-table .add-panel td {
	padding: .333em 0 0 0;
	line-height: 0;
}
.cancel-btn, .ok-btn, .delete-btn  { 
	padding: .111em;
}
.day-modal-title {
	padding: .3em 2em .8em .3em;
}
.day-modal-table {
	min-width: 16.2em;
}
.day-modal-table .day-modal-row {
	height: 1.85em;
	border-bottom: .0555em solid var(--base);
}
.day-modal-table td {
	padding: 0 .2em;
}
.day-modal-table .day-modal-row:nth-last-child(2) {
	border: none;
}
.blurred-row {
	opacity: .26;
}
.day-diagram {
	margin-bottom: .5em;
	overflow: hidden;
	white-space: nowrap;
	height: .35em;
	line-height: 0;
}
.day-diagram div {
	display: inline-block;
	height: 100%;
	background-color: var(--pos);
	box-sizing: border-box;
	border-right: .0555em solid var(--default);
}
.day-diagram div:nth-child(even) {
	background-color: var(--neg);
}
.editable {
	margin: 0 .0555em;
	width: 1.52em;
	border: 0;
	border-bottom: .0555em solid var(--base);
	line-height: 1.25em;
	text-align: center;
	color: #000;
	background-color: transparent;
}
.editable:focus:not(:disabled) {
	background-color: #e2e2e2;
}
.day-modal-table td.method-cell {
	padding-left: 0;
	padding-right: .1em;
}
.method-cell {
	width: 1.2em;
	background: url("icons.svg#unknown") center / .42em .82em no-repeat;
	opacity: .8;
}
.method-1 {
	background-image: url("icons.svg#add");
	background-size: .65em;
}
.method-2 {
	background-image: url("icons.svg#nfc");
	background-size: .6em;
}
.method-3 {
	background-image: url("icons.svg#gps");
	background-size: .98em;
}
.time-cell {
	width: 4.2em;
}
.record-cell {
	width: 1em;
}
.warn-cell {
	width: .8em;
}
td.buttons-cell {
	text-align: right;
	padding-right: .45em;
}
.buttons-cell button {
	margin-left: .333em;
	vertical-align: middle;
}
.buttons-cell .ok-btn, .buttons-cell .cancel-btn  {
	display: none;
}
.remove-candidate {
	color: var(--neg);
	background: linear-gradient(to right, transparent 0%, transparent 15%, var(--neg) 850%) fixed;
}
.remove-candidate .remove-question {
	display: inline;
}
.remove-candidate .editable {
	color: var(--neg);
	border-bottom-color: transparent;
}
.remove-candidate .record-cell .triangle {
	fill: #7f7f7f;
}
.remove-question {
	float: left;
	font-size: .8em;
	font-weight: bold;
	margin-top: .111em;
	margin-left: .166em;
	display: none;
}
.focused-row .ok-btn.to-save, .focused-row .cancel-btn, .focused-row.remove-candidate .ok-btn.to-remove  {
	display: inline;
}
.focused-row.remove-candidate .ok-btn.to-save {
	display: none;
}
.focused-row .remove-btn {
	display: none;
}
.warn-cell.warn-dup {
	background: url("icons.svg#warn-dup") no-repeat center;
	background-size: .8em .8em;
}
.triangle  {
	height: .7em;
}
.triangle.in {
	fill: var(--pos);
}
.triangle.out {
	fill: var(--neg);
	transform: rotate(180deg);
}
.triangle.decide {
	fill: #7f7f7f;
    animation-name: decide-spinning;
    animation-duration: 1.5s;
	animation-iteration-count: infinite;
	animation-timing-function: ease;
}
@keyframes decide-spinning {
	0% {
		fill: var(--pos);
		transform: scaleX(1);
	}
	50% {
		fill: var(--neg);
		transform: scaleX(-1);
	}
	100% {
		fill: var(--pos);
		transform: scaleX(1);
	}
}
.clearfix::after {
	content: "";
	clear: both;
	display: table;
}
.error-modal {
	padding: 1.2em 1.9em .75em 1.9em;
	text-align: center;
}
.error-modal img {
	margin-bottom: .7em;
	width: 1.55em;
	height: 1.55em;
}
.error-message {
	display: block;
	font-size: .9em;
	margin-bottom: .277em;
}

/* Mobile (portrait) */
@media screen and (max-width: 480px) {
	body {
		margin: 1em;
		margin-top: .8em;
	}
	body, input, select {
		font-size: 20px;
		line-height: 20px;
	}
	#content {
		width: 14.5em;
	}
	#dropdown_container {
		height: 2em;
	}
	#refresh_button {
		width: 2em;
	}
	#dropdown {
		padding: 0 .35em;
		width: calc(100% - 2.35em);
	}
	td {
		padding-top: .14em;
		padding-bottom: .14em;
	}
	#modal {
		margin-top: 6vh;
	}
	button {
		transform: scaleX(1.1) scaleY(1.1);
	}
	.day-modal-table td {
		padding-top: .25em;
		padding-bottom: .25em;
	}
	.day-modal-table td .editable{
		height: 100%;
	}
	#add_row td {
		padding-top: .95em;
	}
	.buttons-cell button.cancel-btn {
		margin-left: .55em;
	}
	.add-panel .add-btn {
		width: 92%;
	}
	.frame {
		padding-top: .4444em;
		padding-bottom: .4444em;
	}
	
	/* Remove tap hightlight colors */
	tr[role="button"]::selection, select {
		background-color: transparent;
	}
	tr[role="button"], select {
		-webkit-tap-highlight-color: rgba(0,0,0,0);
		-moz-tap-highlight-color: rgba(0,0,0,0);
		tap-highlight-color: rgba(0,0,0,0);
	}
	
	/* Change tap hightlight colors */
	td[role="button"]::selection, input[type="button"]::selection, button::selection, a::selection {
		background-color: var(--tap);
	}
	td[role="button"], input[type="button"], button, a {
		-webkit-tap-highlight-color: var(--tap);
		-moz-tap-highlight-color: var(--tap);
		tap-highlight-color: var(--tap);
	}
}

/* Avoid remaining focus color on mobile */
@media (pointer:coarse) {
	input[type="button"]:hover {
		background-color: var(--default);
	}
}