@import url('https://fonts.googleapis.com/css2?family=Rubik&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Gochi+Hand&display=swap');
html,
body {
	height: 100%;
	margin: 0;
	padding: 0;
}

body {
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
	font-family: 'Rubik', sans-serif;
	font-size: 14px;
	color: black;
	overflow: hidden;
}

/* Scrollbars, in the header's browns and tans: the list of points, and any
   other scrolling box. Chrome, Edge, and Safari take the ::-webkit-scrollbar
   rules, which allow a shaped thumb. Firefox has no such selectors and takes
   scrollbar-color and scrollbar-width instead; those are kept behind
   @supports because Chrome would otherwise honor them and ignore the richer
   rules. */

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #f5f0e6; }
::-webkit-scrollbar-thumb {
	background: #beb5a7;
	border: 3px solid #f5f0e6;
	border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #d6a254; }
::-webkit-scrollbar-thumb:active { background: #937550; }
::-webkit-scrollbar-corner { background: #f5f0e6; }
::-webkit-scrollbar-button { display: none; }

@supports not selector(::-webkit-scrollbar) {
	* { scrollbar-color: #beb5a7 #f5f0e6; scrollbar-width: thin; }
}

#logo {
	position: absolute;
	top: 0;
	left: 0;
	width: 186px;
	height: 40px;
	background: url(/images/logo-tiny.png);
	z-index: 100;
	pointer-events: none;
}

#toolbar {
	position: relative;
	height: 50px;
	width: 100%;
	background: url(/images/toolbar.png);
}

#toolbar .title {
	position: absolute;
    font-family: 'Gochi Hand', cursive;
    font-size: 17px;
    color: #937550;
}

#toolbar .title.one {
	left: 192px;
	top: 11px;
}

#toolbar .title.two {
	left: 38px;
	top: 29px;
}

#toolbar .account {
	float: right;
	display: flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	margin: 10px 20px 0 0;
	padding: 0 12px;
	border: 1px solid #beb5a7;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.5);
	color: #937550;
	font-size: 14px;
	text-decoration: none;
	transition: all 0.3s ease;
}

#toolbar .account:hover {
	border-color: #d6a254;
	background: white;
	color: #6f5536;
}

#toolbar .account .icon {
	font-size: 16px;
}

#main {
	height: calc(100% - 100px);
	width: 100%;
}

#sidebar {
	float: left;
	width: 300px;
	height: 100%;
}

#map {
	float: right;
	width: calc(100% - 300px);
	height: 100%;
}

#devices {
	position: relative;
	background: url(/images/devices.png);
	height: 40px;
	width: 100%;
}

#devices > button {
	position: absolute;
	display: block;
	top: 2px;
	height: 36px;
	width: 94px;
	font-size: 14px;
	border: 2px solid transparent;
	border-radius: 4px;
	background: transparent;
	transition: all 0.3s ease;
}

#devices > button.selected {
	border: 2px solid #beb5a7;
	background: linear-gradient(180deg, rgb(236, 232, 223) 0%, rgb(233, 230, 222) 35%, rgb(170, 161, 140) 100%);
	transition: all 0.3s ease;
}

#devices > button:hover {
	border: 2px solid #d6a254 !important;
	background: linear-gradient(180deg, rgb(236, 232, 223) 0%, rgb(233, 230, 222) 35%, rgb(170, 161, 140) 100%);
	transition: all 0.3s ease;
}

#devices > button i {
	margin-left: -5px;
	margin-right: 5px;
}

#devices > button#phone {
	left: 4px;
}

/* The trip toggles beside the Phone button, one per trip, in the trip's
   color. Solid with a white number while the trip is shown on the map,
   hollow with a number in its color while it is hidden. */
#trips {
	position: absolute;
	left: 104px;
	top: 0;
	height: 40px;
	display: flex;
	align-items: center;
	gap: 4px;
}

#trips .trip {
	width: 26px;
	height: 26px;
	padding: 0;
	border: 2px solid var(--trip);
	border-radius: 50%;
	background: transparent;
	color: var(--trip);
	font-family: 'Rubik', sans-serif;
	font-size: 12px;
	font-weight: bold;
	line-height: 22px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

#trips .trip.shown {
	background: var(--trip);
	color: white;
}

#trips .trip:hover {
	box-shadow: 0 0 0 2px #d6a254;
}

/* The site's tooltip (app.tooltip.ts): a dark brown box with a tail, below
   its target with the tail pointing up, or above it with the tail pointing
   down. --tail is where along the box the tail sits, set by the script so
   it points at the target even when the box is moved in from an edge. */
.tooltip {
	position: fixed;
	z-index: 20000;
	max-width: 320px;
	padding: 8px 12px;
	border-radius: 6px;
	background: #5f4b22;
	color: white;
	font-family: 'Rubik', sans-serif;
	font-size: 13px;
	line-height: 1.45;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease;
}

.tooltip.show {
	opacity: 1;
	visibility: visible;
}

.tooltip::before {
	content: "";
	position: absolute;
	left: var(--tail, 50%);
	margin-left: -7px;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
}

.tooltip.below::before {
	top: -7px;
	border-bottom: 7px solid #5f4b22;
}

.tooltip.above::before {
	bottom: -7px;
	border-top: 7px solid #5f4b22;
}

.tooltip .caption {
	margin-bottom: 3px;
	font-weight: bold;
}

/* A trip's name, with a dot in its color beside it */
.tooltip .caption.trip {
	padding-left: 18px;
	position: relative;
}

.tooltip .caption.trip::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 11px;
	height: 11px;
	margin-top: -6px;
	border: 1px solid white;
	border-radius: 50%;
	background: var(--trip);
}

.tooltip .stop,
.tooltip .hint {
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
	color: #f3dfb8;
}

.tooltip .hint {
	font-size: 12px;
}

#locations {
	width: 100%;
	height: calc(100% - 40px);
	overflow-x: hidden;
	overflow-y: scroll;
}

#locations .location-arrow {
	pointer-events: none;
	width: 100%;
	height: 1px;
	z-index: 11;
	text-align: center;
	position: relative;
	top: -9px;
	font-size: 11px;
	background: #dfdfdf;
}

#locations .location-arrow .bubble {
	padding: 3px;
	line-height: 20px;
	text-align: center;
	border-radius: 14px;
	color: black;
	background: white;
	border: 1px solid black;
	padding-left: 1em;
	padding-right: 1em;
	top: -9px;
	position: relative;
}

#locations .location-item {
	width: 100%;
	z-index: 10;
	padding: 5px;
	padding-top: 15px;
	font-size: 12px;
	top: -9px;
	position: relative;
	padding-left: 42px;
	padding-bottom: -4px;
}

#locations .location-item .index {
	position: absolute;
	left: 7px;
	top: 15px;
	width: 24px;
	height: 24px;
	border-radius: 15px;
	text-align: center;
	line-height: 24px;
	font-weight: bold;
}

/* Each entry carries --trip, its trip's color, or the phone's */
#locations.phone .location-item.selected .index {
	background: white;
	color: var(--trip, #0c82a0);
}

#locations.phone .location-item .index {
	background: var(--trip, #0c82a0);
	color: white;
}

#locations .location-item .bubble {
	display: inline-block;
	height: 39px;
}

#locations.phone .location-item.selected, #locations.phone .location-item.selected:hover {
	background: var(--trip, #0c82a0);
	color: white;
}

#locations.phone .location-item:hover {
	background: #96d8e9;
	background: color-mix(in srgb, var(--trip, #0c82a0) 40%, white);
}

#graph {
	position: relative;
	background: white;
	border-top: 1px solid rgb(170, 161, 140);
	height: 50px;
	width: 100%;
}

#drawing {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

body.grabbing * {
	cursor: ew-resize !important;
}

body.left * {
	cursor: w-resize !important;
}

body.right * {
	cursor: e-resize !important;
}

#time {
	position: absolute;
	cursor: ew-resize;
	background: rgb(180 180 255 / 40%);
	right: 0px;
	width: 100px;
	height: 100%;
}

#time .left,
#time .right {
	background: rgb(180 180 255 / 90%);
	width: 4px;
	height: 100%;
}

#time .left {
	cursor: w-resize;
	float: left;
}

#time .right {
	cursor: e-resize;
	float: right;
}

/* Hide google maps help and terms */

a[href^="http://maps.google.com/maps"] {
	display: none !important
}

a[href^="https://maps.google.com/maps"] {
	display: none !important
}

.gmnoprint a,
.gmnoprint span,
.gm-style-cc {
	display: none;
}

/* location styles */

.location:hover {
	z-index: 10000 !important;
}

.marker {
	position: relative;
}

.marker .pin {
	color: white;
}

.marker.device:hover .pin, .marker.current:hover .pin {
	transform: scaleY(0.5);
	opacity: 0;
}

.marker:hover .balloon {
	transform: scaleY(1.0);
	opacity: 1;
	visibility: visible;
}

.marker .pin,
.marker .balloon {
	position: absolute;
	transform-origin: bottom center;
	transition: all 0.5s ease;
}

.marker.home .pin, .marker.current .pin {
	position: absolute;
	left: calc(38px / -2);
	top: -48px;
	width: 38px;
	height: 48px;
	font-size: 18px;
	line-height: 36px;
	text-align: center;
	transform-origin: bottom center;
	transition: all 0.5s ease;
}

.marker.home .pin {
	background: url(/images/green-current.png);
}

.marker.current.one .pin {
	left: calc(38px * -1 + 38px / -2);
}

.marker.current.one .balloon {
	left: calc(38px * -1 - 100px);
}

.marker.current.two .pin {
	left: calc(38px * -2 + 38px / -2);
}

.marker.current.two .balloon {
	left: calc(38px * -2 - 100px);
}

.marker.current.three .pin {
	left: calc(38px * -3 + 38px / -2);
}

.marker.current.three .balloon {
	left: calc(38px * -3 - 100px);
}

.marker.current.phone .pin {
	background: url(/images/teal-current.png);
}

.marker.device .pin {
	left: calc(-28px / 2);
	top: -36px;
	width: 28px;
	height: 36px;
	font-size: 13px;
	line-height: 27px;
	font-weight: bold;
	text-align: center;
}

/* The pin is an SVG filled with the trip's color, set on the marker as
   --trip, with the number over it */
.marker.device .pin svg {
	position: absolute;
	left: 0;
	top: 0;
}

.marker.device .pin span {
	position: relative;
}

.topmost {
	z-index: 10000 !important;
}

.marker.device.phone.selected .pin svg path {
	fill: white;
}

.marker.device.phone.selected .pin {
	color: var(--trip, #0c82a0);
}

.marker .balloon {
	left: calc(-200px / 2);
	top: -109px;
	width: 200px;
	height: 109px;
	background: url(/images/balloon.png);
	opacity: 0;
	transform: scaleY(0.5);
	visibility: hidden;
}

.marker.current .balloon .device {
	margin-top: 8px;
	margin-left: 8px;
	font-weight: bold;
}

.marker.current .balloon .street {
	margin-left: 8px;
	margin-right: 8px;
	font-weight: bold;
	/* A place name can be long, such as a store in a shopping center */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.marker.current .balloon .city {
	margin-left: 8px;
	font-weight: bold;
}

.marker.current.one .balloon .seen,
.marker.current.two .balloon .seen,
.marker.current.three .balloon .seen {
	margin-top: 20px;
	text-align: center;
}

.marker.current .balloon .latlon {
	margin-top: 8px;
	text-align: center;
}

.marker.current .balloon .seen {
	text-align: center;
}

.marker.current .balloon .duration {
	text-align: center;
}

.marker.device .balloon * {
	position: absolute;
	display: none;
	left: 28px;
	font-size: 12px;
}

.marker.device .balloon.base * {
	display: block;
}

.marker.device .balloon .index {
	display: inline-block;
	left: 4px;
	top: 4px;
	width: 20px;
	height: 20px;
	line-height: 20px;
	text-align: center;
	border-radius: 10px;
	background: grey;
	color: white;
	font-size: 12px;
	font-weight: bold;
}

.marker.device.phone .balloon .index {
	background: var(--trip, #0c82a0);
}

.marker.device .balloon .street {
	display: block;
	height: 15px;
	overflow: hidden;
	top: 8px;
	font-weight: bold;
	/* A place name can be long, such as a store in a shopping center */
	width: calc(200px - 28px - 8px);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.marker.device .balloon .city {
	display: block;
	height: 15px;
	overflow: hidden;
	top: calc(8px + 16px);
	font-weight: bold;
}

.marker.device .balloon .latlon {
	display: inline-block;
	left: 0;
	width: 200px;
	text-align: center;
	top: calc(16px * 2 + 15px);
}

/* A stay of 5 minutes or more, shown in place of the coordinates */
.marker.device .balloon .latlon.stay {
	font-weight: bold;
	color: var(--trip, #0c82a0);
}

/* Clicking a pin, or its balloon, selects its entry in the list */
.marker.device {
	cursor: pointer;
}

.marker.device .balloon .distance {
	display: inline-block;
	left: 0;
	width: 200px;
	text-align: center;
	top: calc(16px * 3 + 15px);
}

.marker.device .balloon .count {
	display: inline-block;
	left: 0;
	width: 200px;
	text-align: center;
	top: calc(16px * 4 + 15px);
}

#loader {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 10020;
	opacity: 1;
	transition: all 0.25s ease;
}

#loader.hidden {
	opacity: 0;
	pointer-events: none;
	transition: all 0.25s ease;
}

#loader #block {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100px;
	height: 100px;
	margin: -50px -50px 0 0;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.5);
}

#loader #block div {
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	color: white;
}

#timebar {
	position: absolute;
	bottom: 50px;
	left: 500px;
	width: calc(100% - 700px);
	height: 25px;
	pointer-events: none;
	z-index: 10010;
	display: flex;
	justify-content: center;
}

#timewords {
	display: inline-block;
	height: 25px;
	line-height: 22px;
	color: grey;
	font-size: 13px;
	background: white;
	padding-left: 20px;
	padding-right: 20px;
	white-space: nowrap;
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
	border-left: 1px solid rgb(170, 161, 140);
	border-top: 1px solid rgb(170, 161, 140);
	border-right: 1px solid rgb(170, 161, 140);
}

button:active {
	box-shadow: inset 0px 0px 10px #5a5a5a9a;
}